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:
53a3972
)
safe_create_leading_directories(): reduce scope of local variable
author
Michael Haggerty
<mhagger@alum.mit.edu>
Mon, 6 Jan 2014 13:45:20 +0000
(14:45 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 6 Jan 2014 17:34:19 +0000
(09:34 -0800)
This makes it more obvious that values of "st" don't persist across
loop iterations.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c
patch
|
blob
|
history
diff --git
a/sha1_file.c
b/sha1_file.c
index
56b51b0
..
e52a003
100644
(file)
--- a/
sha1_file.c
+++ b/
sha1_file.c
@@
-108,9
+108,10
@@
int mkdir_in_gitdir(const char *path)
int safe_create_leading_directories(char *path)
{
char *pos = path + offset_1st_component(path);
- struct stat st;
while (pos) {
+ struct stat st;
+
pos = strchr(pos, '/');
if (!pos)
break;