Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
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
raw
|
patch
|
inline
| side by side (parent:
53a3972
)
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);
int safe_create_leading_directories(char *path)
{
char *pos = path + offset_1st_component(path);
- struct stat st;
while (pos) {
while (pos) {
+ struct stat st;
+
pos = strchr(pos, '/');
if (!pos)
break;
pos = strchr(pos, '/');
if (!pos)
break;