scc

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

commit e8b4caf9a047bd46d53cd9dc6c61575204c47d65
parent 5af21c8e9b18e3c7156532f16ec9df02bb1e11bb
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 12 Aug 2015 17:32:56 +0200

Add file name in file error reports

Diffstat:
Mcc1/lex.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/cc1/lex.c b/cc1/lex.c @@ -45,9 +45,10 @@ ilex(char *fname) fp = stdin; fname = "<stdin>"; } else { - if ((fp = fopen(fname, "r")) == NULL) - die("error opening output:%s", strerror(errno)); - fname = fname; + if ((fp = fopen(fname, "r")) == NULL) { + die("error opening input '%s':%s", + fname, strerror(errno)); + } } allocinput(fname, fp); *input->begin = '\0';