Same as before, but for _tolower_tab_ As _tolower_tab_ was the last initialized variable from __install_currentrunelocale_ctype(), remove the now empty function.
-- Sebastien Marie Index: b/include/ctype.h =================================================================== --- a/include/ctype.h 2015-06-30 12:19:31.892786432 +0200 +++ b/include/ctype.h 2015-06-30 12:19:34.612825646 +0200 @@ -54,7 +54,7 @@ __BEGIN_DECLS extern const char *_ctype_(void); -extern const short *_tolower_tab_; +extern const short *_tolower_tab_(void); extern const short *_toupper_tab_(void); #if defined(__GNUC__) || defined(_ANSI_LIBRARY) @@ -158,7 +158,7 @@ { if ((unsigned int)_c > 255) return (_c); - return ((_tolower_tab_ + 1)[_c]); + return ((_tolower_tab_() + 1)[_c]); } __only_inline int toupper(int _c) Index: b/lib/libc/gen/tolower_.c =================================================================== --- a/lib/libc/gen/tolower_.c 2015-06-30 12:00:09.503187344 +0200 +++ b/lib/libc/gen/tolower_.c 2015-06-30 12:19:34.612825646 +0200 @@ -45,13 +45,11 @@ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -const short *_tolower_tab_ = _C_tolower_; - #undef tolower int tolower(int c) { if ((unsigned int)c > 255) return(c); - return((_tolower_tab_ + 1)[c]); + return((_tolower_tab_() + 1)[c]); } Index: b/lib/libc/locale/runeglue.c =================================================================== --- a/lib/libc/locale/runeglue.c 2015-06-30 12:19:31.902785988 +0200 +++ b/lib/libc/locale/runeglue.c 2015-06-30 12:19:34.622824992 +0200 @@ -113,15 +113,3 @@ return 0; } - -void -__install_currentrunelocale_ctype(locale_t locale) -{ - if (locale->lc_ctype->rl_tabs != NULL) { - /* LINTED const cast */ - _tolower_tab_ = (const short *) - &(locale->lc_ctype->rl_tabs->tolower_tab); - } else { - _tolower_tab_ = _C_tolower_; - } -} Index: b/lib/libc/locale/xlocale.c =================================================================== --- a/lib/libc/locale/xlocale.c 2015-06-30 12:19:31.902785988 +0200 +++ b/lib/libc/locale/xlocale.c 2015-06-30 12:19:34.622824992 +0200 @@ -44,6 +44,18 @@ /* exported via ctype.h */ const short * +_tolower_tab_() +{ + locale_t loc = _current_locale(); + + if (loc->lc_ctype->rl_tabs != NULL) + return (loc->lc_ctype->rl_tabs->tolower_tab); + else + return (_C_tolower_); +} + +/* exported via ctype.h */ +const short * _toupper_tab_() { locale_t loc = _current_locale(); Index: b/lib/libc/locale/rune_local.h =================================================================== --- a/lib/libc/locale/rune_local.h 2015-06-30 12:18:53.262377426 +0200 +++ b/lib/libc/locale/rune_local.h 2015-06-30 12:19:34.622824992 +0200 @@ -43,7 +43,6 @@ /* runeglue.c */ extern int __make_ctype_tabs(_RuneLocale *); -extern void __install_currentrunelocale_ctype(locale_t); /* ___runetype_mb.c */ extern _RuneType ___runetype_mb(wint_t, locale_t); Index: b/lib/libc/locale/setlocale.c =================================================================== --- a/lib/libc/locale/setlocale.c 2015-06-30 12:18:53.262377426 +0200 +++ b/lib/libc/locale/setlocale.c 2015-06-30 12:19:34.622824992 +0200 @@ -189,7 +189,6 @@ switch (category) { case LC_CTYPE: (void)_xpg4_setrunelocale("C", LC_GLOBAL_LOCALE); - __install_currentrunelocale_ctype(LC_GLOBAL_LOCALE); break; case LC_MESSAGES: case LC_COLLATE: @@ -246,7 +245,6 @@ case LC_CTYPE: if (_xpg4_setrunelocale(locname, LC_GLOBAL_LOCALE)) return -1; - __install_currentrunelocale_ctype(LC_GLOBAL_LOCALE); break; case LC_MESSAGES: