mirror of
https://github.com/git/git.git
synced 2024-11-24 02:17:02 +08:00
dir.c: use ALLOC_GROW() in create_simplify()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
6647cc2626
commit
9af49f822b
5
dir.c
5
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;
|
||||
|
Loading…
Reference in New Issue
Block a user