Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
cache_tree_find(): find the end of path component using strchrnul()
author
Michael Haggerty
<mhagger@alum.mit.edu>
Wed, 5 Mar 2014 17:26:26 +0000
(18:26 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 5 Mar 2014 20:33:30 +0000
(12:33 -0800)
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>
cache-tree.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
72c378d
)
diff --git
a/cache-tree.c
b/cache-tree.c
index 4d439bd915a38f029ff8d54b76f6730231705090..d00f4ef7c2cb44392007e1f41cc2d0bc4d1e5c76 100644
(file)
--- a/
cache-tree.c
+++ b/
cache-tree.c
@@
-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.
*/