git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
6647cc2
)
dir.c: use ALLOC_GROW() in create_simplify()
author
Dmitry S. Dolzhenko
<redacted>
Mon, 3 Mar 2014 22:31:58 +0000
(
02:31
+0400)
committer
Junio C Hamano
<redacted>
Mon, 3 Mar 2014 22:54:29 +0000
(14:54 -0800)
Signed-off-by: Dmitry S. Dolzhenko <redacted>
Signed-off-by: Junio C Hamano <redacted>
dir.c
patch
|
blob
|
history
diff --git
a/dir.c
b/dir.c
index b35b6330f850f610b582b189d7e4d6a9ba4495db..f6c647006b0a2cad4d2f4cb56786e50950007960 100644
(file)
--- a/
dir.c
+++ b/
dir.c
@@
-1329,10
+1329,7
@@
static struct path_simplify *create_simplify(const char **pathspec)
for (nr = 0 ; ; nr++) {
const char *match;
- if (nr >= alloc) {
- alloc = alloc_nr(alloc);
- simplify = xrealloc(simplify, alloc * sizeof(*simplify));
- }
+ ALLOC_GROW(simplify, nr + 1, alloc);
match = *pathspec++;
if (!match)
break;
git clone https://git.99rst.org/PROJECT