diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-05-25 19:03:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-05-25 19:03:20 -0700 |
commit | 417653777a1d073f53b2053cf0b0838a35cfc7d5 (patch) | |
tree | 6ff1bd8c1dbfb3cd047dd96dbd1ed5dcaac08d24 /alias.c | |
parent | 4619136c8b52a4c68bc1529faf5cea71d428ac22 (diff) | |
parent | 27d5438d9f4eb2cefc2a989c68f9b42b529b2a12 (diff) | |
download | git-417653777a1d073f53b2053cf0b0838a35cfc7d5.tar.gz git-417653777a1d073f53b2053cf0b0838a35cfc7d5.tar.xz |
Merge branch 'jk/maint-1.6.0-trace-argv' into maint
* jk/maint-1.6.0-trace-argv:
fix GIT_TRACE segfault with shell-quoted aliases
Conflicts:
alias.c
Diffstat (limited to 'alias.c')
-rw-r--r-- | alias.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -38,10 +38,7 @@ int split_cmdline(char *cmdline, const char ***argv) while (cmdline[++src] && isspace(cmdline[src])) ; /* skip */ - if (count >= size) { - size += 16; - *argv = xrealloc(*argv, sizeof(char *) * size); - } + ALLOC_GROW(*argv, count+1, size); (*argv)[count++] = cmdline + dst; } else if (!quoted && (c == '\'' || c == '"')) { quoted = c; @@ -72,6 +69,9 @@ int split_cmdline(char *cmdline, const char ***argv) return error("unclosed quote"); } + ALLOC_GROW(*argv, count+1, size); + (*argv)[count] = NULL; + return count; } |