cache_tree_find(): use path variable when passing over slashes

The search for the end of the slashes is part of the update of the
path variable for the next iteration as opposed to an update of the
slash variable.  So iterate using path rather than slash.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Michael Haggerty 2014-03-05 18:26:30 +01:00 committed by Junio C Hamano
parent 8b7e5f7972
commit 3491047e14
1 changed files with 3 additions and 2 deletions

View File

@ -563,9 +563,10 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
if (!sub)
return NULL;
it = sub->cache_tree;
while (*slash == '/')
slash++;

path = slash;
while (*path == '/')
path++;
}
return it;
}