xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 39f6bf5cad92e2dde97e5e05cd28f6ecede7b387

Remove/update files_with_newline_in_names test
Author: xaizek
Author date (UTC): 2016-07-09 20:21
Committer name: xaizek
Committer date (UTC): 2016-07-10 09:08
Parent(s): a837ca804601cd459ce1a2dbb80568c5a2a6fa89
Signing key: 99DC5E4DB05F6BE2
Tree: 2fe963bb05433a3e154e9cd380ba58700ecbc1e9
File Lines added Lines deleted
src/running.c 3 2
src/running.h 3 2
tests/misc/flist_custom.c 3 2
File src/running.c changed (mode: 100644) (index 3c84091ba..bfd4b4108)
... ... run_in_split(const FileView *view, const char cmd[])
1320 1320 free(escaped_cmd); free(escaped_cmd);
1321 1321 } }
1322 1322
1323 void
1323 int
1324 1324 output_to_custom_flist(FileView *view, const char cmd[], int very) output_to_custom_flist(FileView *view, const char cmd[], int very)
1325 1325 { {
1326 1326 char *title; char *title;
 
... ... output_to_custom_flist(FileView *view, const char cmd[], int very)
1338 1338 if(error) if(error)
1339 1339 { {
1340 1340 show_error_msgf("Trouble running command", "Unable to run: %s", cmd); show_error_msgf("Trouble running command", "Unable to run: %s", cmd);
1341 return;
1341 return 1;
1342 1342 } }
1343 1343
1344 1344 flist_end_custom(view, very); flist_end_custom(view, very);
1345 return 0;
1345 1346 } }
1346 1347
1347 1348 /* Implements process_cmd_output() callback that loads paths into custom /* Implements process_cmd_output() callback that loads paths into custom
File src/running.h changed (mode: 100644) (index 0abd186ed..f3cf46a59)
... ... int run_with_filetype(FileView *view, const char beginning[], int background);
74 74 int run_ext_command(const char cmd[], MacroFlags flags, int bg, int *save_msg); int run_ext_command(const char cmd[], MacroFlags flags, int bg, int *save_msg);
75 75
76 76 /* Runs the cmd and parses its output as list of paths to compose custom view. /* Runs the cmd and parses its output as list of paths to compose custom view.
77 * Very custom view implies unsorted list. */
78 void output_to_custom_flist(FileView *view, const char cmd[], int very);
77 * Very custom view implies unsorted list. Returns zero on success, otherwise
78 * non-zero is returned. */
79 int output_to_custom_flist(FileView *view, const char cmd[], int very);
79 80
80 81 /* Executes external command capturing its output as list of lines. Sets *files /* Executes external command capturing its output as list of lines. Sets *files
81 82 * and *nfiles. Returns zero on success, otherwise non-zero is returned. */ * and *nfiles. Returns zero on success, otherwise non-zero is returned. */
File tests/misc/flist_custom.c changed (mode: 100644) (index 72f2dfc23..44de1f1fa)
... ... TEST(custom_view_does_not_reset_local_state)
480 480 columns_clear_column_descs(); columns_clear_column_descs();
481 481 } }
482 482
483 TEST(files_with, IF(filenames_can_include_newline))
483 TEST(files_with_newline_in_names, IF(filenames_can_include_newline))
484 484 { {
485 485 FILE *const f = fopen(SANDBOX_PATH "/list", "w"); FILE *const f = fopen(SANDBOX_PATH "/list", "w");
486 486 fprintf(f, "%s%c", SANDBOX_PATH "/a\nb", '\0'); fprintf(f, "%s%c", SANDBOX_PATH "/a\nb", '\0');
 
... ... TEST(files_with, IF(filenames_can_include_newline))
492 492 stats_update_shell_type(cfg.shell); stats_update_shell_type(cfg.shell);
493 493
494 494 create_file("a\nb"); create_file("a\nb");
495 output_to_custom_flist(&lwin, "cat list", 0);
495 assert_non_null(get_cwd(lwin.curr_dir, sizeof(lwin.curr_dir)));
496 assert_success(output_to_custom_flist(&lwin, "cat list", 0));
496 497 assert_success(unlink("a\nb")); assert_success(unlink("a\nb"));
497 498 assert_success(unlink("list")); assert_success(unlink("list"));
498 499
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master