shithub: scc

Download patch

ref: e8b4caf9a047bd46d53cd9dc6c61575204c47d65
parent: 5af21c8e9b18e3c7156532f16ec9df02bb1e11bb
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Aug 12 13:32:56 EDT 2015

Add file name in file error reports

--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -45,9 +45,10 @@
 		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';