git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
72c378d
)
cache_tree_find(): find the end of path component using strchrnul()
author
Michael Haggerty
<redacted>
Wed, 5 Mar 2014 17:26:26 +0000
(18:26 +0100)
committer
Junio C Hamano
<redacted>
Wed, 5 Mar 2014 20:33:30 +0000
(12:33 -0800)
Suggested-by: Junio Hamano <redacted>
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
cache-tree.c
patch
|
blob
|
history
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.
*/
git clone https://git.99rst.org/PROJECT