summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sha1_file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 4dd16c38f6..1d9cc1b66f 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -115,9 +115,10 @@ int safe_create_leading_directories(char *path)
if (!slash)
break;
- while (*(slash + 1) == '/')
- slash++;
+
next_component = slash + 1;
+ while (*next_component == '/')
+ next_component++;
if (!*next_component)
break;