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 <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Michael Haggerty 2014-01-06 14:45:22 +01:00 committed by Junio C Hamano
parent 831651fde8
commit 26c8ae2a57
1 changed files with 5 additions and 5 deletions

View File

@ -107,18 +107,18 @@ int mkdir_in_gitdir(const char *path)

int safe_create_leading_directories(char *path)
{
char *pos = path + offset_1st_component(path);
char *next_component = path + offset_1st_component(path);

while (pos) {
while (next_component) {
struct stat st;
char *slash = strchr(pos, '/');
char *slash = strchr(next_component, '/');

if (!slash)
break;
while (*(slash + 1) == '/')
slash++;
pos = slash + 1;
if (!*pos)
next_component = slash + 1;
if (!*next_component)
break;

*slash = '\0';