cache_tree_find(): find the end of path component using strchrnul()
Suggested-by: Junio Hamano <gitster@pobox.com> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
72c378d8a6
commit
17e22ddc1c
@ -554,9 +554,7 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat
|
||||
const char *slash;
|
||||
struct cache_tree_sub *sub;
|
||||
|
||||
slash = strchr(path, '/');
|
||||
if (!slash)
|
||||
slash = path + strlen(path);
|
||||
slash = strchrnul(path, '/');
|
||||
/* between path and slash is the name of the
|
||||
* subtree to look for.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user