From: Tom Lane Date: Mon, 2 Jan 2006 20:25:45 +0000 (+0000) Subject: Don't assume that LC_MESSAGES is always available on WIN32. Per Magnus. X-Git-Tag: REL8_2_BETA1~1663 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd924b29885b325125e43842a1f094586028aab9;p=postgresql Don't assume that LC_MESSAGES is always available on WIN32. Per Magnus. --- diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index 055082e65f..91881cdbd9 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -4,7 +4,7 @@ * * Portions Copyright (c) 2002-2005, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.33 2005/12/28 23:22:51 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.34 2006/01/02 20:25:45 tgl Exp $ * *----------------------------------------------------------------------- */ @@ -106,15 +106,17 @@ pg_perm_setlocale(int category, const char *locale) * We must ignore attempts to set to "", which means "keep using the * old environment value". */ - if (category != LC_MESSAGES) - result = setlocale(category, locale); - else +#ifdef LC_MESSAGES + if (category == LC_MESSAGES) { result = (char *) locale; if (locale == NULL || locale[0] == '\0') return result; } + else #endif + result = setlocale(category, locale); +#endif /* WIN32 */ if (result == NULL) return result; /* fall out immediately on failure */