shithub: mc

Download patch

ref: 173bb6e6c75b1898527b187c030093bc8832d4fc
parent: 3e92cda1745121a0545c581d9f135feed9e280bd
author: Ori Bernstein <[email protected]>
date: Wed Feb 20 06:58:25 EST 2013

Print the filename in syntax errors.

    Why weren't we doing this earlier?

--- a/parse/gram.y
+++ b/parse/gram.y
@@ -760,7 +760,7 @@
 
 void yyerror(const char *s)
 {
-    fprintf(stderr, "%d: %s", line, s);
+    fprintf(stderr, "%s:%d: %s", filename, line, s);
     if (curtok->str)
         fprintf(stderr, " near \"%s\"", curtok->str);
     fprintf(stderr, "\n");