Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd7013b0

Browse files
committed
On WIN32, don't choke when setlocale(LC_MESSAGES, "") returns NULL.
Per report from Magnus.
1 parent16974ee commitd7013b0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎src/backend/utils/adt/pg_locale.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.25 2004/01/19 19:04:40 tgl Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.26 2004/05/27 19:19:05 tgl Exp $
88
*
99
*-----------------------------------------------------------------------
1010
*/
@@ -131,11 +131,22 @@ locale_messages_assign(const char *value, bool doit, GucSource source)
131131
if (doit)
132132
{
133133
if (!setlocale(LC_MESSAGES,value))
134+
{
135+
#ifdefWIN32
136+
/*
137+
* Win32 returns NULL when you set LC_MESSAGES to "". So don't
138+
* complain unless we're trying to set it to something else.
139+
*/
140+
if (value[0])
141+
returnNULL;
142+
#else
134143
returnNULL;
144+
#endif
145+
}
135146
}
136147
else
137148
value=locale_xxx_assign(LC_MESSAGES,value, false,source);
138-
#endif
149+
#endif/* LC_MESSAGES */
139150
returnvalue;
140151
}
141152

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp