mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
On WIN32, don't choke when setlocale(LC_MESSAGES, "") returns NULL.
Per report from Magnus.
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
|
* 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 (doit)
|
||||||
{
|
{
|
||||||
if (!setlocale(LC_MESSAGES, value))
|
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;
|
return NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
value = locale_xxx_assign(LC_MESSAGES, value, false, source);
|
value = locale_xxx_assign(LC_MESSAGES, value, false, source);
|
||||||
#endif
|
#endif /* LC_MESSAGES */
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user