aboutsummaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2007-06-16 18:43:40 -0400
committerJunio C Hamano <gitster@pobox.com>2007-06-16 18:00:07 -0700
commit25fd2f7a310df17dca298a3acf2aba716ceb8ce3 (patch)
tree12e7f2710c91969b0d9aebb9d8d8ab320459a586 /dir.c
parent1a15fed84a511b86feaed7731850a5629d76a97f (diff)
downloadgit-25fd2f7a310df17dca298a3acf2aba716ceb8ce3.tar.gz
git-25fd2f7a310df17dca298a3acf2aba716ceb8ce3.tar.xz
Fix ALLOC_GROW calls with obsolete semantics
ALLOC_GROW now expects the 'nr' argument to be "how much you want" and not "how much you have". This fixes all cases where we weren't previously adding anything to the 'nr'. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index 98e24adcd..8d8faf5d7 100644
--- a/dir.c
+++ b/dir.c
@@ -286,7 +286,7 @@ struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int
if (cache_name_pos(pathname, len) >= 0)
return NULL;
- ALLOC_GROW(dir->entries, dir->nr, dir->alloc);
+ ALLOC_GROW(dir->entries, dir->nr+1, dir->alloc);
return dir->entries[dir->nr++] = dir_entry_new(pathname, len);
}
@@ -295,7 +295,7 @@ struct dir_entry *dir_add_ignored(struct dir_struct *dir, const char *pathname,
if (cache_name_pos(pathname, len) >= 0)
return NULL;
- ALLOC_GROW(dir->ignored, dir->ignored_nr, dir->ignored_alloc);
+ ALLOC_GROW(dir->ignored, dir->ignored_nr+1, dir->ignored_alloc);
return dir->ignored[dir->ignored_nr++] = dir_entry_new(pathname, len);
}