Commit d7013b0f authored by Tom Lane's avatar Tom Lane

On WIN32, don't choke when setlocale(LC_MESSAGES, "") returns NULL.

Per report from Magnus.
parent 16974ee9
......@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.25 2004/01/19 19:04:40 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.26 2004/05/27 19:19:05 tgl Exp $
*
*-----------------------------------------------------------------------
*/
......@@ -131,11 +131,22 @@ locale_messages_assign(const char *value, bool doit, GucSource source)
if (doit)
{
if (!setlocale(LC_MESSAGES, value))
{
#ifdef WIN32
/*
* Win32 returns NULL when you set LC_MESSAGES to "". So don't
* complain unless we're trying to set it to something else.
*/
if (value[0])
return NULL;
#else
return NULL;
#endif
}
}
else
value = locale_xxx_assign(LC_MESSAGES, value, false, source);
#endif
#endif /* LC_MESSAGES */
return value;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment