Improve backwards compatibility with GNU Make

This commit is contained in:
Justine Tunney 2021-05-02 07:48:59 -07:00
parent fabf7f9f02
commit 1f2288be6e
18 changed files with 412 additions and 96 deletions

View file

@ -239,7 +239,11 @@ void LoadRelationships(int argc, char *argv[]) {
buf += PAGESIZE;
buf[-1] = '\n';
for (i = optind; i < argc; ++i) {
CHECK_NOTNULL((finpaths = fopen(argv[i], "r")));
if (!(finpaths = fopen(argv[i], "r"))) {
fprintf(stderr, "\n\e[1mERROR: %s FAILED BECAUSE %s CAUSED %m\e[0m\n\n",
argv[0], argv[i]);
exit(1);
}
while (getline(&line, &linecap, finpaths) != -1) {
src = chomp(line);
if (ShouldSkipSource(src)) continue;