Commit 5e3ce57ad89618bd4872440fab5fd8a5ffc7b4c9

Stefan Sperling 2019-03-26T09:00:13

return relative paths from got_path_skip_common_ancestor()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/path.c b/lib/path.c
index 5be3f98..487e120 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -132,6 +132,8 @@ got_path_skip_common_ancestor(char **child, const char *parent_abspath,
 		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)