Skip to content

Commit f050233

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 53a3972 commit f050233

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sha1_file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ int mkdir_in_gitdir(const char *path)
108108
int safe_create_leading_directories(char *path)
109109
{
110110
char *pos = path + offset_1st_component(path);
111-
struct stat st;
112111

113112
while (pos) {
113+
struct stat st;
114+
114115
pos = strchr(pos, '/');
115116
if (!pos)
116117
break;

0 commit comments

Comments
 (0)