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>
This commit is contained in:
parent
53a3972171
commit
f05023324c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user