This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.21-126-g0d822a0


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  0d822a016b631aef409df5805f58962fe5bbcdc5 (commit)
      from  ca681b7b7b79bea3af62fe709df6594f3f5457e6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0d822a016b631aef409df5805f58962fe5bbcdc5

commit 0d822a016b631aef409df5805f58962fe5bbcdc5
Author: Alexandre Oliva <aoliva@redhat.com>
Date:   Mon Nov 17 22:00:58 2014 -0200

    BZ #15969: search locale archive again after alias expansion
    
    If a locale alias is defined in locale.alias but not in an archive,
    and the referenced locale is only present in the archive, setlocale
    will fail if given the alias name.  This is unintuitive.  This patch
    fixes it, arranging for the locale archive to be searched again after
    alias expansion.
    
    for  ChangeLog
    
    	[BZ #15969]
    	* locale/findlocale.c (_nl_find_locale): Retry archive search
    	after alias expansion.

diff --git a/ChangeLog b/ChangeLog
index dd590b0..0d7cf37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-26  Alexandre Oliva <aoliva@redhat.com>
+
+	[BZ #15969]
+	* locale/findlocale.c (_nl_find_locale): Retry archive search
+	after alias expansion.
+
 2015-02-25  Roland McGrath  <roland@hack.frob.com>
 
 	* iconv/tst-iconv3.c (main): Converted to ...
diff --git a/NEWS b/NEWS
index 72c685f..db6c5f1 100644
--- a/NEWS
+++ b/NEWS
@@ -9,10 +9,10 @@ Version 2.22
 
 * The following bugs are resolved with this release:
 
-  4719, 14841, 13064, 14094, 15319, 15467, 15790, 16560, 16783, 17269,
-  17523, 17569, 17588, 17792, 17836, 17912, 17916, 17932, 17944, 17949,
-  17964, 17965, 17967, 17969, 17978, 17987, 17991, 17996, 17998, 17999,
-  18019, 18020.
+  4719, 14841, 13064, 14094, 15319, 15467, 15790, 15969, 16560, 16783,
+  17269, 17523, 17569, 17588, 17792, 17836, 17912, 17916, 17932, 17944,
+  17949, 17964, 17965, 17967, 17969, 17978, 17987, 17991, 17996, 17998,
+  17999, 18019, 18020.
 
 * Character encoding and ctype tables were updated to Unicode 7.0.0, using
   new generator scripts contributed by Pravin Satpute and Mike FABIAN (Red
diff --git a/locale/findlocale.c b/locale/findlocale.c
index ab879d7..360f58b 100644
--- a/locale/findlocale.c
+++ b/locale/findlocale.c
@@ -156,15 +156,26 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
       if (__glibc_likely (data != NULL))
 	return data;
 
+      /* Nothing in the archive with the given name.  Expanding it as
+	 an alias and retry.  */
+      loc_name = (char *) _nl_expand_alias (*name);
+      if (loc_name != NULL)
+	{
+	  data = _nl_load_locale_from_archive (category, &loc_name);
+	  if (__builtin_expect (data != NULL, 1))
+	    return data;
+	}
+
       /* Nothing in the archive.  Set the default path to search below.  */
       locale_path = _nl_default_locale_path;
       locale_path_len = sizeof _nl_default_locale_path;
     }
+  else
+    /* We really have to load some data.  First see whether the name is
+       an alias.  Please note that this makes it impossible to have "C"
+       or "POSIX" as aliases.  */
+    loc_name = (char *) _nl_expand_alias (*name);
 
-  /* We really have to load some data.  First see whether the name is
-     an alias.  Please note that this makes it impossible to have "C"
-     or "POSIX" as aliases.  */
-  loc_name = (char *) _nl_expand_alias (*name);
   if (loc_name == NULL)
     /* It is no alias.  */
     loc_name = (char *) *name;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    6 ++++++
 NEWS                |    8 ++++----
 locale/findlocale.c |   19 +++++++++++++++----
 3 files changed, 25 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]