Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 28df6a0

Browse files
committed
Update "pg_regress --no-locale" for Darwin and Windows.
Commit 894459e revealed this option to be broken for NLS builds on Darwin, but "make -C contrib/unaccent check" and the buildfarm client rely on it. Fix that configuration by redefining the option to imply LANG=C on Darwin. In passing, use LANG=C instead of LANG=en on Windows; since only postmaster startup uses that value, testers are unlikely to notice the change. Back-patch to 9.0, like the predecessor commit.
1 parent c480cb9 commit 28df6a0

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/test/regress/pg_regress.c

+11-3
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,17 @@ initialize_environment(void)
790790
unsetenv("LC_NUMERIC");
791791
unsetenv("LC_TIME");
792792
unsetenv("LANG");
793-
/* On Windows the default locale cannot be English, so force it */
794-
#if defined(WIN32) || defined(__CYGWIN__)
795-
putenv("LANG=en");
793+
794+
/*
795+
* Most platforms have adopted the POSIX locale as their
796+
* implementation-defined default locale. Exceptions include native
797+
* Windows, Darwin with --enable-nls, and Cygwin with --enable-nls.
798+
* (Use of --enable-nls matters because libintl replaces setlocale().)
799+
* Also, PostgreSQL does not support Darwin with locale environment
800+
* variables unset; see PostmasterMain().
801+
*/
802+
#if defined(WIN32) || defined(__CYGWIN__) || defined(__darwin__)
803+
putenv("LANG=C");
796804
#endif
797805
}
798806

0 commit comments

Comments
 (0)