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

diff --git a/gnulib b/gnulib
index 50bb21e..0202658 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 50bb21eab7dfc87bbfcbc75f0232407110cdd296
+Subproject commit 02026583ed4aba1e5866b06e0418aecbb071e426
diff --git a/src/main.c b/src/main.c
index fdb26ac..57fa533 100644
--- a/src/main.c
+++ b/src/main.c
@@ -44,17 +44,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[])
 {
@@ -64,6 +65,14 @@ main (int argc, char *argv[])
   (void) bindtextdomain ("bison-runtime", LOCALEDIR);
   (void) textdomain (PACKAGE);
 
+  {
+    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 d34c110..b66e954 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
-- 
1.7.9

