From 8c328a87a2cf061499bb2e28b4322bf5d35ab362 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 7 Feb 2021 15:07:06 +0100 Subject: take existence of a dofile into account when checking for sourcefile This resolves issues when the .dep.redo went missing or the file was built by other means. Closes #6. --- redo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/redo.c b/redo.c index 141434c..2a297e9 100644 --- a/redo.c +++ b/redo.c @@ -398,7 +398,14 @@ static int sourcefile(char *target) { target = targetchdir(target); - return access(target, F_OK) == 0 && access(targetdep(target), F_OK) != 0; + + if (access(targetdep(target), F_OK) == 0) + return 0; + + if (!fflag) + return access(target, F_OK) == 0; + + return find_dofile(target) == 0; } static int -- cgit 1.4.1