We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 70ec868 + 18e051a commit 05f08e4Copy full SHA for 05f08e4
setup.c
@@ -7,10 +7,13 @@ static int inside_work_tree = -1;
7
char *prefix_path(const char *prefix, int len, const char *path)
8
{
9
const char *orig = path;
10
- char *sanitized = xmalloc(len + strlen(path) + 1);
11
- if (is_absolute_path(orig))
12
- strcpy(sanitized, path);
13
- else {
+ char *sanitized;
+ if (is_absolute_path(orig)) {
+ const char *temp = make_absolute_path(path);
+ sanitized = xmalloc(len + strlen(temp) + 1);
14
+ strcpy(sanitized, temp);
15
+ } else {
16
+ sanitized = xmalloc(len + strlen(path) + 1);
17
if (len)
18
memcpy(sanitized, prefix, len);
19
strcpy(sanitized + len, path);
0 commit comments