diff options
author | Leah Neukirchen <leah@vuxu.org> | 2021-02-07 15:07:06 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2021-02-07 15:07:06 +0100 |
commit | 8c328a87a2cf061499bb2e28b4322bf5d35ab362 (patch) | |
tree | 2a8e22cd7b20f3d9ae0a8798551f44885fc9aeb0 | |
parent | 11d6ac4107bee4368bb2618e1f256822558e1ccc (diff) | |
download | redo-c-8c328a87a2cf061499bb2e28b4322bf5d35ab362.tar.gz redo-c-8c328a87a2cf061499bb2e28b4322bf5d35ab362.tar.xz redo-c-8c328a87a2cf061499bb2e28b4322bf5d35ab362.zip |
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.
-rw-r--r-- | redo.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 |