From: Stef Walter Date: Mon, 17 Jun 2013 12:45:36 +0000 (+0200) Subject: tools: Fix passing args to external commands X-Git-Tag: 0.18.4~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e32481727387460d5900d0bbb495d3694facf64b;p=p11-kit tools: Fix passing args to external commands There were various bugs passing arguments, with duplicates being passed, as well as certain arguments being skipped.t --- diff --git a/tools/tool.c b/tools/tool.c index dcbb1a5..313484a 100644 --- a/tools/tool.c +++ b/tools/tool.c @@ -204,6 +204,8 @@ exec_external (const char *command, return_if_fail (path != NULL); argv[0] = filename; + argv[argc] = NULL; + execvp (path, argv); } @@ -245,6 +247,8 @@ main (int argc, char *argv[]) if (!command) { skip = true; command = argv[in]; + } else { + skip = false; } /* The global long options */