From 41187c8e7873e53bca109412e35a7ce172d7676e Mon Sep 17 00:00:00 2001
From: Akim Demaille <demaille@gostai.com>
Date: Wed, 8 Feb 2012 14:44:24 +0100
Subject: [PATCH] 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: Disable it during the tests.
---
 gnulib           |    2 +-
 src/main.c       |   12 +++++++++++-
 tests/atlocal.in |    4 ++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/gnulib b/gnulib
index 44c4f75..309ff52 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 44c4f75581a7774594e5a225ab43c9c211e4abb4
+Subproject commit 309ff5255861a18a50784ead7a839c159d47ecf1
diff --git a/src/main.c b/src/main.c
index 3dbac3a..acf140b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -43,17 +43,18 @@
 #include "print.h"
 #include "print_graph.h"
 #include "print-xml.h"
+#include <quote.h>
 #include "reader.h"
 #include "reduce.h"
 #include "scan-code.h"
 #include "scan-gram.h"
 #include "scan-skel.h"
+#include <streq.h>
 #include "symtab.h"
 #include "tables.h"
 #include "uniqstr.h"
 
 
-
 int
 main (int argc, char *argv[])
 {
@@ -63,6 +64,15 @@ main (int argc, char *argv[])
   (void) bindtextdomain ("bison-runtime", LOCALEDIR);
   (void) textdomain (PACKAGE);
 
+  {
+    quote_init ();
+    char const *cp = getenv ("LC_CTYPE");
+    if (cp && STREQ (cp, "C", 'C', 0,0,0,0,0,0,0,0))
+      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 764540c..d005f85 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -45,3 +45,7 @@ CONF_JAVA='@CONF_JAVA@'
 
 # We need egrep.
 : ${EGREP='@EGREP@'}
+
+# Use simple quotes (lib/quote.c).
+LC_CTYPE=C
+export LC_CTYPE
-- 
1.7.9

