about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--redo.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/redo.c b/redo.c
index 978e3d1..4351479 100644
--- a/redo.c
+++ b/redo.c
@@ -459,7 +459,6 @@ run_script(char *target, int implicit)
 	char *orig_target = target;
 	int old_dep_fd = dep_fd;
 	int fd;
-	int shellwrap;
 	char *dofile;
 	pid_t pid;
 
@@ -478,8 +477,6 @@ run_script(char *target, int implicit)
 		exit(1);
 	}
 
-	shellwrap = (access (dofile, X_OK) != 0);
-
 	fd = open(dofile, O_RDONLY);
 	dprintf(dep_fd, "=%s %s\n", hashfile(fd), dofile);
 	close(fd);
@@ -515,7 +512,7 @@ djb-style default.o.do:
 		setenvfd("REDO_DEP_FD", dep_fd);
 		setenvfd("REDO_LEVEL", level + 1);
 
-		if (shellwrap)
+		if (access (dofile, X_OK) != 0)  // run -x files with /bin/sh
 			execl("/bin/sh", "/bin/sh", xflag > 0 ? "-ex" : "-e",
 			    dofile, target, basename, temp_target, (char *) 0);
 		else