scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 94acab63933f1d05f6e7d35dcd3e1dd7bf655d5a
parent ad2e30089260ee4dc4bb7bd674ab65516ffee854
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 14 Feb 2017 14:48:22 +0100

[cc1] Return error in addinput() when a file cannot be openend

This function is used to try to open the included files, if it
die() when a file isn't found then it is impossible to try
the next location.

Diffstat:
Mcc1/lex.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/lex.c b/cc1/lex.c @@ -103,7 +103,7 @@ addinput(char *fname, Symbol *hide, char *buffer) } else if (fname) { /* a new file */ if ((fp = fopen(fname, "r")) == NULL) - die("Error opening '%s': %s", fname, strerror(errno)); + return 0; flags = IFILE; if (curip && onlyheader) printf("%s: %s\n", infile, fname);