diff options
author | Tharre <tharre3@gmail.com> | 2016-05-02 04:25:28 +0200 |
---|---|---|
committer | Tharre <tharre3@gmail.com> | 2016-05-02 04:25:40 +0200 |
commit | 0a9f087c1b34d5d1656586f4e11f18e10a22120f (patch) | |
tree | 30ae498f6e8d21861e2b7d7c38944274946802aa | |
parent | 29fb2912ef6100a9659c2f065c683424f2a964a4 (diff) | |
download | redo-0a9f087c1b34d5d1656586f4e11f18e10a22120f.tar.gz redo-0a9f087c1b34d5d1656586f4e11f18e10a22120f.tar.xz redo-0a9f087c1b34d5d1656586f4e11f18e10a22120f.zip |
Handle absolute $3 correctly
-rw-r--r-- | src/build.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/build.c b/src/build.c index 9702bad..d16b484 100644 --- a/src/build.c +++ b/src/build.c @@ -97,6 +97,10 @@ static int build_target(dep_info *dep) { } else if (pid == 0) { /* child */ + char *abstemp = xrealpath(temp_output); + if (!abstemp) + fatal("redo: failed to get realpath() of %s", temp_output); + /* change directory to our target */ char *dirc = xstrdup(doscripts->chosen); char *ddoscript = dirname(dirc); @@ -106,7 +110,7 @@ static int build_target(dep_info *dep) { free(dirc); char **argv = parse_shebang(xbasename(dep->target), - xbasename(doscripts->chosen), xrealpath(temp_output)); + xbasename(doscripts->chosen), abstemp); /* set "REDO_PARENT_TARGET" */ if (setenv("REDO_PARENT_TARGET", dep->target, 1)) |