Skip to content

Commit fd924b2

Browse files
committed
Don't assume that LC_MESSAGES is always available on WIN32. Per Magnus.
1 parent 499f4d5 commit fd924b2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backend/utils/adt/pg_locale.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 2002-2005, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.33 2005/12/28 23:22:51 tgl Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.34 2006/01/02 20:25:45 tgl Exp $
88
*
99
*-----------------------------------------------------------------------
1010
*/
@@ -106,15 +106,17 @@ pg_perm_setlocale(int category, const char *locale)
106106
* We must ignore attempts to set to "", which means "keep using the
107107
* old environment value".
108108
*/
109-
if (category != LC_MESSAGES)
110-
result = setlocale(category, locale);
111-
else
109+
#ifdef LC_MESSAGES
110+
if (category == LC_MESSAGES)
112111
{
113112
result = (char *) locale;
114113
if (locale == NULL || locale[0] == '\0')
115114
return result;
116115
}
116+
else
117117
#endif
118+
result = setlocale(category, locale);
119+
#endif /* WIN32 */
118120

119121
if (result == NULL)
120122
return result; /* fall out immediately on failure */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy