Commit Diff


commit - db5ba8eda276cd122138244b297aa510587dedf9
commit + 5e3ce57ad89618bd4872440fab5fd8a5ffc7b4c9
blob - 5be3f989e2aabee5e86bfe855d0752862edd8580
blob + 487e120c8cd12a0a3b7d5ec4f6272064cb3a5f26
--- lib/path.c
+++ lib/path.c
@@ -132,6 +132,8 @@ got_path_skip_common_ancestor(char **child, const char
 		return got_error(GOT_ERR_BAD_PATH);
 	if (abspath[len_parent] != '/')
 		return got_error(GOT_ERR_BAD_PATH);
+	while (abspath[len_parent] == '/')
+		abspath++;
 	bufsize = len - len_parent + 1;
 	*child = malloc(bufsize);
 	if (*child == NULL)