Skip to content

Commit 05f08e4

Browse files
committed
Merge branch 'cb/setup'
* cb/setup: setup: translate symlinks in filename when using absolute paths
2 parents 70ec868 + 18e051a commit 05f08e4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

setup.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ static int inside_work_tree = -1;
77
char *prefix_path(const char *prefix, int len, const char *path)
88
{
99
const char *orig = path;
10-
char *sanitized = xmalloc(len + strlen(path) + 1);
11-
if (is_absolute_path(orig))
12-
strcpy(sanitized, path);
13-
else {
10+
char *sanitized;
11+
if (is_absolute_path(orig)) {
12+
const char *temp = make_absolute_path(path);
13+
sanitized = xmalloc(len + strlen(temp) + 1);
14+
strcpy(sanitized, temp);
15+
} else {
16+
sanitized = xmalloc(len + strlen(path) + 1);
1417
if (len)
1518
memcpy(sanitized, prefix, len);
1619
strcpy(sanitized + len, path);

0 commit comments

Comments
 (0)