Last patch for removing new_categories as global variable.

The variable is now (after patch 1 and 2) only used in setlocale()
function.

The variable content isn't used outside the function, as the content is
copied from new_categories to current_categories variable.

The variable could be passed from global to local variable of
setlocale().

-- 
Sébastien Marie


Index: locale/setlocale.c
===================================================================
RCS file: /cvs/src/lib/libc/locale/setlocale.c,v
retrieving revision 1.21
diff -u -p -r1.21 setlocale.c
--- locale/setlocale.c  9 Jun 2015 20:04:04 -0000       1.21
+++ locale/setlocale.c  12 Jun 2015 13:56:16 -0000
@@ -68,17 +68,12 @@ static char current_categories[_LC_LAST]
     "C"
 };
 
-/*
- * The locales we are going to try and load
- */
-static char new_categories[_LC_LAST][32];
-
 static char current_locale_string[_LC_LAST * 33];
 
 static char    *currentlocale(void);
 static void revert_to_default(int);
 static int load_locale_sub(int, const char *);
-static char    *loadlocale(int);
+static char    *loadlocale(int, const char *);
 static const char *__get_locale_env(int);
 
 char *
@@ -87,6 +82,7 @@ setlocale(int category, const char *loca
        int i, loadlocale_success;
        size_t len;
        const char *env, *r;
+       char new_categories[_LC_LAST][32];
 
        if (category < 0 || category >= _LC_LAST)
                return (NULL);

Reply via email to