summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-06-17 14:45:36 +0200
committerStef Walter <stef@thewalter.net>2013-06-17 14:45:36 +0200
commite32481727387460d5900d0bbb495d3694facf64b (patch)
treefec69fcc09e324105240fffaa73f60dc1eec4b80
parentb6e065cda1db37a6c8ed52dac3432468e1277323 (diff)
downloadp11-kit-e32481727387460d5900d0bbb495d3694facf64b.tar.gz
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
-rw-r--r--tools/tool.c4
1 files changed, 4 insertions, 0 deletions
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 */