1 commit 4f031072a5055abd83717820b59efdaa463d5853
2 Author: Ulrich Drepper <drepper@gmail.com>
3 Date: Sat May 28 16:59:30 2011 -0400
5 Handle failure of _nl_explode_name in all cases
7 2011-05-28 Ulrich Drepper <drepper@gmail.com>
9 * locale/findlocale.c (_nl_find_locale): Return right away if
10 _nl_explode_name failed.
11 * locale/programs/locarchive.c (add_locale_to_archive): Likewise.
13 diff --git a/locale/findlocale.c b/locale/findlocale.c
14 index 6b88c96..2fec9a7 100644
15 --- a/locale/findlocale.c
16 +++ b/locale/findlocale.c
18 -/* Copyright (C) 1996-2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
19 +/* Copyright (C) 1996-2003, 2006, 2010, 2011 Free Software Foundation, Inc.
20 This file is part of the GNU C Library.
21 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
23 @@ -140,6 +140,9 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
25 mask = _nl_explode_name (loc_name, &language, &modifier, &territory,
26 &codeset, &normalized_codeset);
28 + /* Memory allocate problem. */
31 /* If exactly this locale was already asked for we have an entry with
33 diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
34 index 85ba77d..e95bcf1 100644
35 --- a/locale/programs/locarchive.c
36 +++ b/locale/programs/locarchive.c
38 -/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
39 +/* Copyright (C) 2002,2003,2005,2007,2009,2011 Free Software Foundation, Inc.
40 This file is part of the GNU C Library.
41 Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
43 @@ -1079,6 +1079,8 @@ add_locale_to_archive (ah, name, data, replace)
44 int mask = _nl_explode_name (strdupa (name),
45 &language, &modifier, &territory,
46 &codeset, &normalized_codeset);
50 if (mask & XPG_NORM_CODESET)
51 /* This name contains a codeset in unnormalized form.
52 @@ -1128,6 +1130,7 @@ add_locale_to_archive (ah, name, data, replace)
54 /* Now read the locale.alias files looking for lines whose
55 right hand side matches our name after normalization. */
57 if (alias_file != NULL)
60 @@ -1207,6 +1210,11 @@ add_locale_to_archive (ah, name, data, replace)
63 &rhs_normalized_codeset);
69 if (!strcmp (language, rhs_language)
70 && ((rhs_mask & XPG_CODESET)
71 /* He has a codeset, it must match normalized. */
72 @@ -1240,6 +1248,7 @@ add_locale_to_archive (ah, name, data, replace)
80 @@ -1248,7 +1257,7 @@ add_locale_to_archive (ah, name, data, replace)
81 if (mask & XPG_NORM_CODESET)
82 free ((char *) normalized_codeset);