safe_create_leading_directories(): reduce scope of local variable
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>
Michael Haggerty committed
Jan 6, 2014 at 14:45 UTC
f05023324c74bd12e66ac1dd04bbe2692c31dbfb
1 file changed
+2
-1
sha1_file.c
+2
-1
@@ -108,9 +108,10 @@ int mkdir_in_gitdir(const char *path)
108
int safe_create_leading_directories(char *path)
109
{
110
char *pos = path + offset_1st_component(path);
111
- struct stat st;
111
112
while (pos) {
113
+ struct stat st;
114
+
115
pos = strchr(pos, '/');
116
if (!pos)
117
break;