diff options
Diffstat (limited to 'builtin-ls-files.c')
-rw-r--r-- | builtin-ls-files.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 2e6f43bb97..b70da1863b 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -273,7 +273,8 @@ static void prune_cache(const char *prefix) if (pos < 0) pos = -pos-1; - active_cache += pos; + memmove(active_cache, active_cache + pos, + (active_nr - pos) * sizeof(struct cache_entry *)); active_nr -= pos; first = 0; last = active_nr; |