Commit 2840f7155236a942e37138a120142e77794eabf4

Stefan Sperling 2019-07-11T12:57:15

new realpath(3) doesn't like receiving an empty path as input

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/repository.c b/lib/repository.c
index 42b69ef..c8076c6 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -472,7 +472,7 @@ got_repo_map_path(char **in_repo_path, struct got_repository *repo,
 
 	repo_abspath = got_repo_get_path(repo);
 
-	if (!check_disk) {
+	if (!check_disk || canonpath[0] == '\0') {
 		path = strdup(canonpath);
 		if (path == NULL) {
 			err = got_error_from_errno("strdup");