about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-03-22 17:29:39 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-03-22 17:29:39 +0100
commita14647aa20f003ef70c7ad2de915605ccacfd00b (patch)
tree06602c3da398f026b43d7d3b1be9cd2720cf72aa
parentce99fa1e68fb044a1100e009d3285daab599d4aa (diff)
downloadredo-c-a14647aa20f003ef70c7ad2de915605ccacfd00b.tar.gz
redo-c-a14647aa20f003ef70c7ad2de915605ccacfd00b.tar.xz
redo-c-a14647aa20f003ef70c7ad2de915605ccacfd00b.zip
check_deps: always chdir back after calling sourcefile
-rw-r--r--redo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/redo.c b/redo.c
index 4885095..d5ae55c 100644
--- a/redo.c
+++ b/redo.c
@@ -447,9 +447,9 @@ check_deps(char *target)
 					close(fd);
 				}
 				// hash is good, recurse into dependencies
-				if (ok && strcmp(target, filename) != 0 &&
-				    !sourcefile(filename)) {
-					ok = check_deps(filename);
+				if (ok && strcmp(target, filename) != 0) {
+					if (!sourcefile(filename))
+						ok = check_deps(filename);
 					fchdir(dir_fd);
 				}
 				break;