Blame SOURCES/glibc-rh971416-1.patch

147e83
commit 0d822a016b631aef409df5805f58962fe5bbcdc5
147e83
Author: Alexandre Oliva <aoliva@redhat.com>
147e83
Date:   Mon Nov 17 22:00:58 2014 -0200
147e83
147e83
    BZ #15969: search locale archive again after alias expansion
147e83
    
147e83
    If a locale alias is defined in locale.alias but not in an archive,
147e83
    and the referenced locale is only present in the archive, setlocale
147e83
    will fail if given the alias name.  This is unintuitive.  This patch
147e83
    fixes it, arranging for the locale archive to be searched again after
147e83
    alias expansion.
147e83
    
147e83
    for  ChangeLog
147e83
    
147e83
    	[BZ #15969]
147e83
    	* locale/findlocale.c (_nl_find_locale): Retry archive search
147e83
    	after alias expansion.
147e83
147e83
Index: b/locale/findlocale.c
147e83
===================================================================
147e83
--- a/locale/findlocale.c
147e83
+++ b/locale/findlocale.c
147e83
@@ -156,15 +156,26 @@ _nl_find_locale (const char *locale_path
147e83
       if (__builtin_expect (data != NULL, 1))
147e83
 	return data;
147e83
 
147e83
+      /* Nothing in the archive with the given name.  Expanding it as
147e83
+	 an alias and retry.  */
147e83
+      loc_name = (char *) _nl_expand_alias (*name);
147e83
+      if (loc_name != NULL)
147e83
+	{
147e83
+	  data = _nl_load_locale_from_archive (category, &loc_name);
147e83
+	  if (__builtin_expect (data != NULL, 1))
147e83
+	    return data;
147e83
+	}
147e83
+
147e83
       /* Nothing in the archive.  Set the default path to search below.  */
147e83
       locale_path = _nl_default_locale_path;
147e83
       locale_path_len = sizeof _nl_default_locale_path;
147e83
     }
147e83
+  else
147e83
+    /* We really have to load some data.  First see whether the name is
147e83
+       an alias.  Please note that this makes it impossible to have "C"
147e83
+       or "POSIX" as aliases.  */
147e83
+    loc_name = (char *) _nl_expand_alias (*name);
147e83
 
147e83
-  /* We really have to load some data.  First see whether the name is
147e83
-     an alias.  Please note that this makes it impossible to have "C"
147e83
-     or "POSIX" as aliases.  */
147e83
-  loc_name = (char *) _nl_expand_alias (*name);
147e83
   if (loc_name == NULL)
147e83
     /* It is no alias.  */
147e83
     loc_name = (char *) *name;