summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-08-05 13:28:01 +0200
committerJim Meyering <meyering@redhat.com>2012-09-03 19:45:03 +0200
commit457bf91968a87a01dfb5317b008497ac4dcde8a4 (patch)
treedef7467177e219629ae0f38bbd713f96bc12d073
parent2e350a617f9f770c92c99da491419fbd08155e8a (diff)
downloadbison-457bf91968a87a01dfb5317b008497ac4dcde8a4.tar.gz
use locale-indep. c_is* functions for parsing, not isspace, isprint etc
* 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.
-rw-r--r--src/parse-gram.c5
-rw-r--r--src/parse-gram.y5
-rw-r--r--src/scan-gram.l4
3 files changed, 8 insertions, 6 deletions
diff --git a/src/parse-gram.c b/src/parse-gram.c
index a04f2f23..037035bc 100644
--- a/src/parse-gram.c
+++ b/src/parse-gram.c
@@ -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)
diff --git a/src/parse-gram.y b/src/parse-gram.y
index 02af75e2..3120bfc2 100644
--- a/src/parse-gram.y
+++ b/src/parse-gram.y
@@ -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)
diff --git a/src/scan-gram.l b/src/scan-gram.l
index 75023f4f..dbea2a1d 100644
--- a/src/scan-gram.l
+++ b/src/scan-gram.l
@@ -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);