commit eef9542c44a360aeec73151d75342f0559a590b4 from: Stefan Sperling date: Thu Oct 22 20:37:50 2020 UTC preserve what was passed in if got_repo_map_path() can't figure out a path problem found by + ok naddy commit - 603cdeb0c7bcddc1abea9ced622f6eaa82c00f35 commit + eef9542c44a360aeec73151d75342f0559a590b4 blob - 3c8f844ad272da6c878fec6aac3e13d424e13af1 blob + 6d8ef4d381dbaffd92e0c0addbe3c8d1567a43d2 --- lib/repository.c +++ lib/repository.c @@ -824,8 +824,11 @@ got_repo_map_path(char **in_repo_path, struct got_repo if (got_repo_is_bare(repo)) { /* * Matched an on-disk path inside repository - * database. Treat as repository-relative. + * database. Treat input as repository-relative. */ + free(path); + path = canonpath; + canonpath = NULL; } else { char *child; /* Strip common prefix with repository path. */ @@ -839,8 +842,11 @@ got_repo_map_path(char **in_repo_path, struct got_repo } else { /* * Matched unrelated on-disk path. - * Treat it as repository-relative. + * Treat input as repository-relative. */ + free(path); + path = canonpath; + canonpath = NULL; } }