OSDN Git Service
(root)
/
git-core
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72c378d
)
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
diff --git
a/cache-tree.c
b/cache-tree.c
index
4d439bd
..
d00f4ef
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.
*/