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>

Michael Haggerty committed Mar 5, 2014 at 18:26 UTC 3491047e14532f4c01e3459d59d914d9598721c5
1 file changed +3 -2
cache-tree.c
+3 -2
@@ -563,9 +563,10 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
563 if (!sub)
564 return NULL;
565 it = sub->cache_tree;
566 - while (*slash == '/')
567 - slash++;
566 +
567 path = slash;
568 + while (*path == '/')
569 + path++;
570 }
571 return it;
572 }