]> granicus.if.org Git - p11-kit/commitdiff
tools: Fix passing args to external commands
authorStef Walter <stef@thewalter.net>
Mon, 17 Jun 2013 12:45:36 +0000 (14:45 +0200)
committerStef Walter <stef@thewalter.net>
Mon, 17 Jun 2013 12:45:36 +0000 (14:45 +0200)
There were various bugs passing arguments, with duplicates being
passed, as well as certain arguments being skipped.t

tools/tool.c

index dcbb1a50435fe0b55cffaee5d77d169693c2e3e0..313484a171b0d6516c3a76ea24e00e99985371b5 100644 (file)
@@ -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 */