File src/menus/menus.c changed (mode: 100644) (index 6c796ce3a..ce2cf1b8e) |
... |
... |
menus_capture(view_t *view, const char cmd[], int user_sh, menu_data_t *m, |
841 |
841 |
if(custom_view || very_custom_view) |
if(custom_view || very_custom_view) |
842 |
842 |
{ |
{ |
843 |
843 |
menus_reset_data(m); |
menus_reset_data(m); |
844 |
|
output_to_custom_flist(view, cmd, very_custom_view, 0); |
|
|
844 |
|
rn_for_flist(view, cmd, very_custom_view, 0); |
845 |
845 |
return 0; |
return 0; |
846 |
846 |
} |
} |
847 |
847 |
|
|
File src/running.c changed (mode: 100644) (index 62be457af..d1328f4c9) |
... |
... |
rn_ext(const char cmd[], MacroFlags flags, int bg, int *save_msg) |
1227 |
1227 |
ONE_OF(flags, MF_VERYCUSTOMVIEW_OUTPUT, MF_VERYCUSTOMVIEW_IOUTPUT); |
ONE_OF(flags, MF_VERYCUSTOMVIEW_OUTPUT, MF_VERYCUSTOMVIEW_IOUTPUT); |
1228 |
1228 |
const int interactive = |
const int interactive = |
1229 |
1229 |
ONE_OF(flags, MF_CUSTOMVIEW_IOUTPUT, MF_VERYCUSTOMVIEW_IOUTPUT); |
ONE_OF(flags, MF_CUSTOMVIEW_IOUTPUT, MF_VERYCUSTOMVIEW_IOUTPUT); |
1230 |
|
output_to_custom_flist(curr_view, cmd, very, interactive); |
|
|
1230 |
|
rn_for_flist(curr_view, cmd, very, interactive); |
1231 |
1231 |
} |
} |
1232 |
1232 |
else |
else |
1233 |
1233 |
{ |
{ |
|
... |
... |
run_in_split(const view_t *view, const char cmd[]) |
1357 |
1357 |
} |
} |
1358 |
1358 |
|
|
1359 |
1359 |
int |
int |
1360 |
|
output_to_custom_flist(view_t *view, const char cmd[], int very, |
|
1361 |
|
int interactive) |
|
|
1360 |
|
rn_for_flist(view_t *view, const char cmd[], int very, int interactive) |
1362 |
1361 |
{ |
{ |
1363 |
1362 |
char *title; |
char *title; |
1364 |
1363 |
int error; |
int error; |
File src/running.h changed (mode: 100644) (index f8017cc5e..10630b650) |
... |
... |
int rn_ext(const char cmd[], MacroFlags flags, int bg, int *save_msg); |
81 |
81 |
/* 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. |
82 |
82 |
* Very custom view implies unsorted list. Returns zero on success, otherwise |
* Very custom view implies unsorted list. Returns zero on success, otherwise |
83 |
83 |
* non-zero is returned. */ |
* non-zero is returned. */ |
84 |
|
int output_to_custom_flist(struct view_t *view, const char cmd[], int very, |
|
|
84 |
|
int rn_for_flist(struct view_t *view, const char cmd[], int very, |
85 |
85 |
int interactive); |
int interactive); |
86 |
86 |
|
|
87 |
87 |
/* Executes external command capturing its output as list of lines. Sets *files |
/* Executes external command capturing its output as list of lines. Sets *files |
File tests/misc/flist_custom.c changed (mode: 100644) (index f3d0107ea..9c6433389) |
... |
... |
TEST(files_with_newline_in_names, IF(filenames_can_include_newline)) |
458 |
458 |
|
|
459 |
459 |
create_file("a\nb"); |
create_file("a\nb"); |
460 |
460 |
assert_non_null(get_cwd(lwin.curr_dir, sizeof(lwin.curr_dir))); |
assert_non_null(get_cwd(lwin.curr_dir, sizeof(lwin.curr_dir))); |
461 |
|
assert_success(output_to_custom_flist(&lwin, "cat list", 0, 0)); |
|
|
461 |
|
assert_success(rn_for_flist(&lwin, "cat list", 0, 0)); |
462 |
462 |
assert_success(unlink("a\nb")); |
assert_success(unlink("a\nb")); |
463 |
463 |
assert_success(unlink("list")); |
assert_success(unlink("list")); |
464 |
464 |
|
|
|
... |
... |
TEST(current_directory_can_be_added_via_dot) |
487 |
487 |
#endif |
#endif |
488 |
488 |
stats_update_shell_type(cfg.shell); |
stats_update_shell_type(cfg.shell); |
489 |
489 |
|
|
490 |
|
assert_success(output_to_custom_flist(&lwin, "echo ../misc", 0, 0)); |
|
|
490 |
|
assert_success(rn_for_flist(&lwin, "echo ../misc", 0, 0)); |
491 |
491 |
|
|
492 |
492 |
stats_update_shell_type("/bin/sh"); |
stats_update_shell_type("/bin/sh"); |
493 |
493 |
update_string(&cfg.shell, NULL); |
update_string(&cfg.shell, NULL); |