Allow passing additional parameters to shell_exec()

This allows for specifying multiple command line parameters to be passed
on to the command in a way similar to fork_exec(). This is useful if we
want to wrap editor or pager invocations in a shell.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-05-16 15:55:40 +02:00
parent 2951cf8320
commit ce13b70c5a
4 changed files with 45 additions and 6 deletions

View File

@@ -469,6 +469,7 @@ void
todo_pipe_item (void)
{
char cmd[BUFSIZ] = "";
char const *arg[] = { cmd, NULL };
int pout;
int pid;
FILE *fpout;
@@ -479,7 +480,7 @@ todo_pipe_item (void)
return;
wins_prepare_external ();
if ((pid = shell_exec (NULL, &pout, cmd)))
if ((pid = shell_exec (NULL, &pout, *arg, arg)))
{
fpout = fdopen (pout, "w");