]> git.saurik.com Git - bison.git/commitdiff
use locale-indep. c_is* functions for parsing, not isspace, isprint etc
authorJim Meyering <meyering@redhat.com>
Sun, 5 Aug 2012 11:28:01 +0000 (13:28 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 3 Sep 2012 17:45:03 +0000 (19:45 +0200)
* src/parse-gram.y: Include "c-ctype.h".
(add_param): Parse with c_isspace, not isspace.
* src/parse-gram.c: Likewise.
* src/scan-gram.l: Include c-ctype.h, not ctype.h.
(SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER): Use c_isspace and c_isprint,
not ctype.h's locale-dependent functions.

src/parse-gram.c
src/parse-gram.y
src/scan-gram.l

index a04f2f237be8ba18c1c048a44f832d4ec8eec4ff..037035bc9489078e537682eefd2a8a80273fe4fe 100644 (file)
@@ -94,6 +94,7 @@
 #include <config.h>
 #include "system.h"
 
+#include "c-ctype.h"
 #include "complain.h"
 #include "conflicts.h"
 #include "files.h"
@@ -3170,11 +3171,11 @@ add_param (char const *type, char *decl, location loc)
   /* Strip the surrounding '{' and '}', and any blanks just inside
      the braces.  */
   --p;
-  while (isspace ((unsigned char) *p))
+  while (c_isspace ((unsigned char) *p))
     --p;
   p[1] = '\0';
   ++decl;
-  while (isspace ((unsigned char) *decl))
+  while (c_isspace ((unsigned char) *decl))
     ++decl;
 
   if (! name_start)
index 02af75e2968d5a2a237f9ff73beea3ba628a9c65..3120bfc210e72ddf921f04ffc34b1ed2ae26d548 100644 (file)
@@ -20,6 +20,7 @@
 #include <config.h>
 #include "system.h"
 
+#include "c-ctype.h"
 #include "complain.h"
 #include "conflicts.h"
 #include "files.h"
@@ -735,11 +736,11 @@ add_param (char const *type, char *decl, location loc)
   /* Strip the surrounding '{' and '}', and any blanks just inside
      the braces.  */
   --p;
-  while (isspace ((unsigned char) *p))
+  while (c_isspace ((unsigned char) *p))
     --p;
   p[1] = '\0';
   ++decl;
-  while (isspace ((unsigned char) *decl))
+  while (c_isspace ((unsigned char) *decl))
     ++decl;
 
   if (! name_start)
index 75023f4f6fac24117a4114d855ba4b7231371a73..dbea2a1d783b91d95a417ec9d20aa5794cdf0b4a 100644 (file)
@@ -36,7 +36,7 @@
 #include "reader.h"
 #include "uniqstr.h"
 
-#include <ctype.h>
+#include <c-ctype.h>
 #include <mbswidth.h>
 #include <quote.h>
 
@@ -560,7 +560,7 @@ splice       (\\[ \f\t\v]*\n)*
   \\(.|\n)     {
     char const *p = yytext + 1;
     /* Quote only if escaping won't make the character visible.  */
-    if (isspace ((unsigned char) *p) && isprint ((unsigned char) *p))
+    if (c_isspace ((unsigned char) *p) && c_isprint ((unsigned char) *p))
       p = quote (p);
     else
       p = quotearg_style_mem (escape_quoting_style, p, 1);