X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/ae93e4e4b8e78396a7707de3dcdd47aca7a46dec..9fd33c2b6ef5d98ac14ac7d83bc453b148fda768:/src/scan-gram.l?ds=sidebyside

diff --git a/src/scan-gram.l b/src/scan-gram.l
index 449fbea9..d375fc12 100644
--- a/src/scan-gram.l
+++ b/src/scan-gram.l
@@ -941,8 +941,8 @@ handle_syncline (char *args, location loc)
 {
   char *after_num;
   unsigned long int lineno = strtoul (args, &after_num, 10);
-  char *file = mbschr (after_num, '"') + 1;
-  *mbschr (file, '"') = '\0';
+  char *file = strchr (after_num, '"') + 1;
+  *strchr (file, '"') = '\0';
   if (INT_MAX <= lineno)
     {
       warn_at (loc, _("line number overflow"));
@@ -965,6 +965,10 @@ unexpected_end (boundary start, char const *msgid, char const *token_end)
   location loc;
   loc.start = start;
   loc.end = scanner_cursor;
+  token_end = quote (token_end);
+  // Instead of '\'', display "'".
+  if (STREQ (token_end, "'\\''"))
+    token_end = "\"'\"";
   complain_at (loc, _(msgid), token_end);
 }
 
@@ -977,7 +981,7 @@ unexpected_end (boundary start, char const *msgid, char const *token_end)
 static void
 unexpected_eof (boundary start, char const *token_end)
 {
-  unexpected_end (start, N_("missing '%s' at end of file"), token_end);
+  unexpected_end (start, N_("missing %s at end of file"), token_end);
 }
 
 
@@ -988,7 +992,7 @@ unexpected_eof (boundary start, char const *token_end)
 static void
 unexpected_newline (boundary start, char const *token_end)
 {
-  unexpected_end (start, N_("missing '%s' at end of line"), token_end);
+  unexpected_end (start, N_("missing %s at end of line"), token_end);
 }