From 7a80ad74f4379b5960e723d124069f190fa4e877 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Mon, 13 Dec 2021 01:56:48 -0800 Subject: [PATCH] Cordon off glibc locale vars just for glibc 2.2 Phew --- src/env_dispatch.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/env_dispatch.cpp b/src/env_dispatch.cpp index 0331d31fa..896803cf9 100644 --- a/src/env_dispatch.cpp +++ b/src/env_dispatch.cpp @@ -62,22 +62,28 @@ /// List of all locale environment variable names that might trigger (re)initializing the locale /// subsystem. static const wcstring locale_variables[] = {L"LANG", - L"LANGUAGE", L"LC_ALL", - L"LC_ADDRESS", L"LC_COLLATE", L"LC_CTYPE", - L"LC_IDENTIFICATION", - L"LC_MEASUREMENT", L"LC_MESSAGES", L"LC_MONETARY", - L"LC_NAME", L"LC_NUMERIC", + L"LC_TIME", +#if defined(_GNU_SOURCE) && defined(__GLIBC__) && defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2,2) + L"LANGUAGE", /* GNU libc extensions start */ + L"LC_ADDRESS", + L"LC_IDENTIFICATION", + L"LC_MEASUREMENT", + L"LC_NAME", L"LC_PAPER", L"LC_TELEPHONE", - L"LC_TIME", - L"fish_allow_singlebyte_locale", - L"LOCPATH"}; + L"LOCPATH", /* GNU libc extensions end */ +#endif // __GLIBC_PREREQ(2,2) +#endif // defined(_GNU_SOURCE) && defined(__GLIBC__) && defined(__GLIBC_PREREQ) + L"fish_allow_singlebyte_locale" + }; + /// List of all curses environment variable names that might trigger (re)initializing the curses /// subsystem.