mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 23:57:13 +08:00
51 lines
1.2 KiB
Diff
51 lines
1.2 KiB
Diff
--- 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;
|
|
}
|