summaryrefslogtreecommitdiff
path: root/src/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/path.c b/src/path.c
index 4888123bf..03ebfe090 100644
--- a/src/path.c
+++ b/src/path.c
@@ -329,6 +329,7 @@ int git_path_walk_up(
iter.ptr = path->ptr;
iter.size = path->size;
+ iter.asize = path->asize;
while (scan >= stop) {
if ((error = cb(data, &iter)) < GIT_SUCCESS)
@@ -343,7 +344,8 @@ int git_path_walk_up(
}
}
- iter.ptr[scan] = oldc;
+ if (scan >= 0)
+ iter.ptr[scan] = oldc;
return error;
}