summaryrefslogtreecommitdiff
path: root/extra/m17n-lib/locale.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extra/m17n-lib/locale.patch')
-rw-r--r--extra/m17n-lib/locale.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/extra/m17n-lib/locale.patch b/extra/m17n-lib/locale.patch
new file mode 100644
index 000000000..79fed402d
--- /dev/null
+++ b/extra/m17n-lib/locale.patch
@@ -0,0 +1,51 @@
+--- old/src/locale.c 2010/03/19 11:59:43 1.12
++++ new/src/locale.c 2010/11/05 11:20:41 1.13
+@@ -86,34 +86,24 @@
+ MLocale *mlocale_monetary, *mlocale_numeric, ;
+ #endif
+
+-/** Parse locale name NAME and return a newly created MLocale object.
+- If the locale is not supported by the system, return NULL. */
++/** Parse locale name NAME and return a newly created MLocale object. */
+
+ static MLocale *
+ make_locale (const char *name)
+ {
+- char *current, *new, *str;
++ char *str;
+ int len;
+ MLocale *locale;
+ char c;
+
+- str = setlocale (LC_CTYPE, NULL);
+- len = strlen (str) + 1;
+- current = alloca (len);
+- memcpy (current, str, len);
+-
+- if (! (new = setlocale (LC_CTYPE, name)))
+- return NULL;
+-
+-
+ M17N_OBJECT (locale, NULL, MERROR_LOCALE);
+- locale->name = msymbol (new);
++ locale->name = msymbol (name);
+ msymbol_put (locale->name, M_locale, (void *) locale);
+ M17N_OBJECT_UNREF (locale);
+
+- len = strlen (new) + 1;
++ len = strlen (name) + 1;
+ str = alloca (len);
+- memcpy (str, new, len);
++ memcpy (str, name, len);
+
+ c = '\0';
+ while (1)
+@@ -162,8 +152,6 @@
+ }
+ else
+ locale->coding = Mcoding_us_ascii;
+-
+- setlocale (LC_CTYPE, current);
+ return locale;
+ }
+