Skip to content
forked from git/git

Commit

Permalink
Merge branch 'jk/maint-1.6.0-trace-argv' into maint
Browse files Browse the repository at this point in the history
* jk/maint-1.6.0-trace-argv:
  fix GIT_TRACE segfault with shell-quoted aliases

Conflicts:
	alias.c
  • Loading branch information
gitster committed May 26, 2009
2 parents 4619136 + 27d5438 commit 4176537
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

0 comments on commit 4176537

Please sign in to comment.