From 0a9f087c1b34d5d1656586f4e11f18e10a22120f Mon Sep 17 00:00:00 2001 From: Tharre Date: Mon, 2 May 2016 04:25:28 +0200 Subject: Handle absolute $3 correctly --- src/build.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3-70-g09d2