diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-03-04 13:41:53 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-03-04 23:12:54 (JST) |
commit | 973deda0eaf4e16c8cc0b25ca1bff1faae17584e (patch) | |
tree | b7be3fb3739a511ee7132fefc1defa62e2e2a2d6 | |
parent | bdae1d8a8d39206ac75ab86f8e9ef53b2f29432e (diff) | |
download | cgit-973deda0eaf4e16c8cc0b25ca1bff1faae17584e.zip cgit-973deda0eaf4e16c8cc0b25ca1bff1faae17584e.tar.gz |
ui-snapshot.c: Fill argv[0] with dummy.
parse_archive_args does not pass PARSE_OPT_KEEP_ARGV0 to parse_args,
which means the first argument will be discarded, as though it were a
function being called from the command-line. Thus, we fill argv[0] with
a dummy argument to prevent this from happening.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | ui-snapshot.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c index 281899d..54e659c 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c | |||
@@ -14,6 +14,7 @@ | |||
14 | static int write_archive_type(const char *format, const char *hex, const char *prefix) | 14 | static int write_archive_type(const char *format, const char *hex, const char *prefix) |
15 | { | 15 | { |
16 | struct argv_array argv = ARGV_ARRAY_INIT; | 16 | struct argv_array argv = ARGV_ARRAY_INIT; |
17 | argv_array_push(&argv, "snapshot"); | ||
17 | argv_array_push(&argv, format); | 18 | argv_array_push(&argv, format); |
18 | if (prefix) { | 19 | if (prefix) { |
19 | argv_array_push(&argv, "--prefix"); | 20 | argv_array_push(&argv, "--prefix"); |