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
This commit is contained in:
commit
417653777a
8
alias.c
8
alias.c
@ -38,10 +38,7 @@ int split_cmdline(char *cmdline, const char ***argv)
|
|||||||
while (cmdline[++src]
|
while (cmdline[++src]
|
||||||
&& isspace(cmdline[src]))
|
&& isspace(cmdline[src]))
|
||||||
; /* skip */
|
; /* skip */
|
||||||
if (count >= size) {
|
ALLOC_GROW(*argv, count+1, size);
|
||||||
size += 16;
|
|
||||||
*argv = xrealloc(*argv, sizeof(char *) * size);
|
|
||||||
}
|
|
||||||
(*argv)[count++] = cmdline + dst;
|
(*argv)[count++] = cmdline + dst;
|
||||||
} else if (!quoted && (c == '\'' || c == '"')) {
|
} else if (!quoted && (c == '\'' || c == '"')) {
|
||||||
quoted = c;
|
quoted = c;
|
||||||
@ -72,6 +69,9 @@ int split_cmdline(char *cmdline, const char ***argv)
|
|||||||
return error("unclosed quote");
|
return error("unclosed quote");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ALLOC_GROW(*argv, count+1, size);
|
||||||
|
(*argv)[count] = NULL;
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user