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 6c1db86e80..171d449048 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -280,7 +280,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; |