Browse Source

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>
maint
Michael Haggerty 11 years ago committed by Junio C Hamano
parent
commit
f05023324c
  1. 3
      sha1_file.c

3
sha1_file.c

@ -108,9 +108,10 @@ int mkdir_in_gitdir(const char *path) @@ -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…
Cancel
Save