From: Michael Haggerty Date: Wed, 5 Mar 2014 17:26:30 +0000 (+0100) Subject: cache_tree_find(): use path variable when passing over slashes X-Git-Tag: v2.0.0-rc0~91^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3491047e14532f4c01e3459d59d914d9598721c5?ds=sidebyside 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 Signed-off-by: Junio C Hamano --- diff --git a/cache-tree.c b/cache-tree.c index 17db9f9045..7f8d74dbcd 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -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; }