(setlocale): Don't call _nl_find_locale for LC_ALL.
authordrepper <drepper>
Sun, 17 Oct 1999 22:41:36 +0000 (22:41 +0000)
committerdrepper <drepper>
Sun, 17 Oct 1999 22:41:36 +0000 (22:41 +0000)
locale/setlocale.c

index c0f453c..8f40520 100644 (file)
@@ -305,26 +305,27 @@ setlocale (int category, const char *locale)
 
       /* Load the new data for each category.  */
       while (category-- > 0)
-       {
-         /* XXX hack.  Remove when collation works.  */
-         if (category == LC_COLLATE)
-           {
-             newdata[category] = NULL;
-             continue;
-           }
+       if (category != LC_ALL)
+         {
+           /* XXX hack.  Remove when collation works.  */
+           if (category == LC_COLLATE)
+             {
+               newdata[category] = NULL;
+               continue;
+             }
 
-         newdata[category] = _nl_find_locale (locale_path, locale_path_len,
-                                              category,
-                                              &newnames[category]);
+           newdata[category] = _nl_find_locale (locale_path, locale_path_len,
+                                                category,
+                                                &newnames[category]);
 
-         if (newdata[category] == NULL)
-           break;
+           if (newdata[category] == NULL)
+             break;
 
-         /* We must not simply free a global locale since we have no
-            control over the usage.  So we mark it as un-deletable.  */
-         if (newdata[category]->usage_count != UNDELETABLE)
-           newdata[category]->usage_count = UNDELETABLE;
-       }
+           /* We must not simply free a global locale since we have no
+              control over the usage.  So we mark it as un-deletable.  */
+           if (newdata[category]->usage_count != UNDELETABLE)
+             newdata[category]->usage_count = UNDELETABLE;
+         }
 
       /* Create new composite name.  */
       composite = (category >= 0