Print this page
Fix compile errors, code review feedback, and add basic libc test suite.
*** 70,82 ****
errno = EINVAL;
return (NULL);
}
if (locname == NULL)
! return (current_locale(__global_locale, category));
! if ((oldloc = duplocale(__global_locale)) == NULL)
return (NULL);
mask = (category == LC_ALL ? LC_ALL_MASK : (1 << category));
newloc = newlocale(mask, locname, oldloc);
--- 70,82 ----
errno = EINVAL;
return (NULL);
}
if (locname == NULL)
! return (current_locale(___global_locale, category));
! if ((oldloc = duplocale(___global_locale)) == NULL)
return (NULL);
mask = (category == LC_ALL ? LC_ALL_MASK : (1 << category));
newloc = newlocale(mask, locname, oldloc);
*** 83,94 ****
if (newloc == NULL) {
freelocale(oldloc);
return (NULL);
}
! oldloc = __global_locale;
! __global_locale = newloc;
install_legacy(newloc, mask);
freelocale(oldloc);
return (current_locale(newloc, category));
--- 83,94 ----
if (newloc == NULL) {
freelocale(oldloc);
return (NULL);
}
! oldloc = ___global_locale;
! ___global_locale = newloc;
install_legacy(newloc, mask);
freelocale(oldloc);
return (current_locale(newloc, category));