The original test is broken. It tests for a NULL locale which
isn't just wrong, it simply can't occur at this point due to an
earlier check for a NULL locale string. Thus, the locale info
for a category is never taken from the environment.
Fixes Coverty CID 153467.
Also, add comment.
Also, add some parens for readability.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Only access "C" locale using the new __get_C_locale inline function.
Enable __global_locale for !_MB_CAPABLE targets. Accommodate !_MB_CAPABLE
targets in new locale code.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
- Setting the categories strings in tmp_locale short-circuits
__loadlocale. Use a new_categories array instead, just as in
_setlocale_r.
- If we have a base, copy over the *not* defined categories in
category_mask in the first place. Rearrange loop accordingly.
- Free base right in newlocale.
Signed-off by: Corinna Vinschen <corinna@vinschen.de>