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 08787a61bd70fe8a2581795817d3a457eabac88e

Rename run_cmd_for_output() to rn_for_lines()
Author: xaizek
Author date (UTC): 2020-02-06 14:25
Committer name: xaizek
Committer date (UTC): 2020-02-06 14:27
Parent(s): a228bb06be9bcd0e32d4888a13d18944968a4f8c
Signing key: 99DC5E4DB05F6BE2
Tree: 0709d448fdd9f8458bc64dc2aef53007de7d5ba0
File Lines added Lines deleted
src/flist_sel.c 1 1
src/running.c 3 3
src/running.h 3 3
File src/flist_sel.c changed (mode: 100644) (index be99d1c2b..78b45636a)
... ... flist_sel_by_filter(view_t *view, const char cmd[], int erase_old, int select)
257 257
258 258 char *const expanded_cmd = ma_expand(cmd, NULL, NULL, 1); char *const expanded_cmd = ma_expand(cmd, NULL, NULL, 1);
259 259
260 if(run_cmd_for_output(expanded_cmd, &files, &nfiles) != 0)
260 if(rn_for_lines(expanded_cmd, &files, &nfiles) != 0)
261 261 { {
262 262 free(expanded_cmd); free(expanded_cmd);
263 263 ui_sb_err("Failed to start/read output of external command"); ui_sb_err("Failed to start/read output of external command");
File src/running.c changed (mode: 100644) (index d1328f4c9..b14236eb9)
... ... path_handler(const char line[], void *arg)
1396 1396 } }
1397 1397
1398 1398 int int
1399 run_cmd_for_output(const char cmd[], char ***files, int *nfiles)
1399 rn_for_lines(const char cmd[], char ***lines, int *nlines)
1400 1400 { {
1401 1401 int error; int error;
1402 1402 strlist_t list = {}; strlist_t list = {};
 
... ... run_cmd_for_output(const char cmd[], char ***files, int *nfiles)
1412 1412 return 1; return 1;
1413 1413 } }
1414 1414
1415 *files = list.items;
1416 *nfiles = list.nitems;
1415 *lines = list.items;
1416 *nlines = list.nitems;
1417 1417 return 0; return 0;
1418 1418 } }
1419 1419
File src/running.h changed (mode: 100644) (index 10630b650..4bcb2a703)
... ... int rn_ext(const char cmd[], MacroFlags flags, int bg, int *save_msg);
84 84 int rn_for_flist(struct view_t *view, const char cmd[], int very, int rn_for_flist(struct view_t *view, const char cmd[], int very,
85 85 int interactive); int interactive);
86 86
87 /* Executes external command capturing its output as list of lines. Sets *files
88 * and *nfiles. Returns zero on success, otherwise non-zero is returned. */
89 int run_cmd_for_output(const char cmd[], char ***files, int *nfiles);
87 /* Executes external command capturing its output as list of lines. Sets *lines
88 * and *nlines. Returns zero on success, otherwise non-zero is returned. */
89 int rn_for_lines(const char cmd[], char ***lines, int *nlines);
90 90
91 91 #endif /* VIFM__RUNNING_H__ */ #endif /* VIFM__RUNNING_H__ */
92 92
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