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:
53a3972
)
safe_create_leading_directories(): reduce scope of local variable
author
Michael Haggerty
<redacted>
Mon, 6 Jan 2014 13:45:20 +0000
(14:45 +0100)
committer
Junio C Hamano
<redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
sha1_file.c
patch
|
blob
|
history
diff --git
a/sha1_file.c
b/sha1_file.c
index 56b51b03e4079420402433eb4bb326a8476a915b..e52a0032e556fe0907de1a6f9e10b09c6bfc6dc9 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;
git clone https://git.99rst.org/PROJECT