1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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;
}
|