Skip to content

Commit 26c8ae2

Browse files
mhaggergitster
authored andcommitted
safe_create_leading_directories(): rename local variable
Rename "pos" to "next_component", because now it always points at the next component of the path name that has to be processed. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 831651f commit 26c8ae2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sha1_file.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,18 @@ int mkdir_in_gitdir(const char *path)
107107

108108
int safe_create_leading_directories(char *path)
109109
{
110-
char *pos = path + offset_1st_component(path);
110+
char *next_component = path + offset_1st_component(path);
111111

112-
while (pos) {
112+
while (next_component) {
113113
struct stat st;
114-
char *slash = strchr(pos, '/');
114+
char *slash = strchr(next_component, '/');
115115

116116
if (!slash)
117117
break;
118118
while (*(slash + 1) == '/')
119119
slash++;
120-
pos = slash + 1;
121-
if (!*pos)
120+
next_component = slash + 1;
121+
if (!*next_component)
122122
break;
123123

124124
*slash = '\0';

0 commit comments

Comments
 (0)