Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jk/maint-1.6.0-trace-argv'
author
Junio C Hamano
<gitster@pobox.com>
Sat, 23 May 2009 08:39:08 +0000
(
01:39
-0700)
committer
Junio C Hamano
<gitster@pobox.com>
Sat, 23 May 2009 08:39:08 +0000
(
01:39
-0700)
* jk/maint-1.6.0-trace-argv:
fix GIT_TRACE segfault with shell-quoted aliases
Conflicts:
alias.c
alias.c
patch
|
blob
|
history
raw
(from parent 1:
15d29dd
)
diff --git
a/alias.c
b/alias.c
index e687fe54c1ce2a435e8f0d7806db231c06f998eb..372b7d809301f9e3e936459e405cd6f2627bd4a9 100644
(file)
--- a/
alias.c
+++ b/
alias.c
@@
-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;
}