summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <demaille@gostai.com>2012-02-08 14:44:24 +0100
committerAkim Demaille <demaille@gostai.com>2012-03-09 08:28:31 +0100
commit06e0e52ca4450a00113d5a157e791363bf57de83 (patch)
tree8cac74fd7a5ff61c428cefd41889f8e17e13147e
parentf0f62c8c4d98bd4d10fb7164b82352d98fc32564 (diff)
downloadbison-06e0e52ca4450a00113d5a157e791363bf57de83.tar.gz
tests: be robust to quote style.
See <http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>. * src/main.c (main): Define the quoting style we use. * tests/atlocal.in: Use ASCII style quotes during the tests. (cherry picked from commit 39ac121457237a14437ee7d7bae28e368a201a7a)
-rw-r--r--src/main.c10
-rw-r--r--tests/atlocal.in4
2 files changed, 13 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index fdb26ac6..0396b0f1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -44,6 +44,7 @@
#include "print.h"
#include "print_graph.h"
#include "print-xml.h"
+#include <quote.h>
#include "reader.h"
#include "reduce.h"
#include "scan-code.h"
@@ -54,7 +55,6 @@
#include "uniqstr.h"
-
int
main (int argc, char *argv[])
{
@@ -64,6 +64,14 @@ main (int argc, char *argv[])
(void) bindtextdomain ("bison-runtime", LOCALEDIR);
(void) textdomain (PACKAGE);
+ {
+ char const *cp = getenv ("LC_CTYPE");
+ if (cp && !strcmp (cp, "C"))
+ set_custom_quoting (&quote_quoting_options, "'", "'");
+ else
+ set_quoting_style (&quote_quoting_options, locale_quoting_style);
+ }
+
atexit (close_stdout);
uniqstrs_new ();
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 6f182806..8f5b1a90 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -58,3 +58,7 @@ CONF_JAVA='@CONF_JAVA@'
# We need egrep.
: ${EGREP='@EGREP@'}
+
+# Use simple quotes (lib/quote.c).
+LC_CTYPE=C
+export LC_CTYPE