diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-16 23:53:30 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2014-07-16 23:53:30 +0200 |
commit | 71234ec0bd16c490239eefcf98069ceb7a7f7618 (patch) | |
tree | 96700d7cbdf97ca7f1906948be66548712b15226 /src/wins.c | |
parent | b37ed2fcc8a4c64419cf066d3c940fc29b7a2d73 (diff) | |
download | calcurse-71234ec0bd16c490239eefcf98069ceb7a7f7618.zip |
Refactor wins_launch_external()
Allow for passing an arbitrary number of arguments. This also allows us
to remove wins_launch_external2() and use wins_launch_external() at all
call sites instead.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/wins.c')
-rw-r--r-- | src/wins.c | 19 |
1 files changed, 1 insertions, 18 deletions
@@ -600,25 +600,8 @@ void wins_unprepare_external(void) * While inside interactive mode, launch the external command cmd on the given * file. */ -void wins_launch_external(const char *file, const char *cmd) +void wins_launch_external(const char *arg[]) { - const char *arg[] = { cmd, file, NULL }; - int pid; - - wins_prepare_external(); - if ((pid = shell_exec(NULL, NULL, *arg, arg))) - child_wait(NULL, NULL, pid); - wins_unprepare_external(); -} - -/* - * While inside interactive mode, launch the external command cmd on the given - * two files. - */ -void wins_launch_external2(const char *file1, const char *file2, - const char *cmd) -{ - const char *arg[] = { cmd, file1, file2, NULL }; int pid; wins_prepare_external(); |