bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix build in locales with decimal comma


From: Miloslav Trmac
Subject: [PATCH] Fix build in locales with decimal comma
Date: Wed, 14 Feb 2007 16:28:37 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20070212)

Hi,
the attached patch against current CVS fixes @multitable
@columnfractions (and texinfo build) in locales where the decimal comma
is used, e.g. cs_CZ.UTF-8.

main () carefully keeps LC_NUMERIC set to "C", getdocumenttext ()
currently overrides LC_NUMERIC from the environment.

        * makeinfo/makeinfo.c (getdocumenttext): Correctly save and
        restore the current locale configuration.

Thanks,
        Mirek
Index: makeinfo/makeinfo.c
===================================================================
RCS file: /sources/texinfo/texinfo/makeinfo/makeinfo.c,v
retrieving revision 1.90
diff -u -r1.90 makeinfo.c
--- makeinfo/makeinfo.c 7 Feb 2007 17:00:38 -0000       1.90
+++ makeinfo/makeinfo.c 14 Feb 2007 15:24:53 -0000
@@ -4245,6 +4245,9 @@
   char *old_LC_ALL;
   char *old_LANGUAGE;
   const char *result;
+#ifdef HAVE_SETLOCALE
+  char *old_locale;
+#endif
 
   /* Save LC_ALL, LANGUAGE environment variables.  */
 
@@ -4258,6 +4261,7 @@
   unsetenv ("LANGUAGE");
 
 #ifdef HAVE_SETLOCALE
+  old_locale = xstrdup (setlocale (LC_ALL, NULL));
   if (setlocale (LC_ALL, "") == NULL)
     /* Nonexistent locale.  Use the original.  */
     result = msgid;
@@ -4281,7 +4285,8 @@
     unsetenv ("LANGUAGE");
 
 #ifdef HAVE_SETLOCALE
-  setlocale (LC_ALL, "");
+  setlocale (LC_ALL, old_locale);
+  free (old_locale);
 #endif
 
   return result;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]