mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
pgindent run for 8.2.
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Portions Copyright (c) 2002-2006, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.36 2006/06/03 17:36:10 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.37 2006/10/04 00:29:59 momjian Exp $
|
||||
*
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
@ -70,6 +70,7 @@ static bool CurrentLocaleConvValid = false;
|
||||
|
||||
static char lc_collate_envbuf[LC_ENV_BUFSIZE];
|
||||
static char lc_ctype_envbuf[LC_ENV_BUFSIZE];
|
||||
|
||||
#ifdef LC_MESSAGES
|
||||
static char lc_messages_envbuf[LC_ENV_BUFSIZE];
|
||||
#endif
|
||||
@ -93,18 +94,19 @@ static char lc_time_envbuf[LC_ENV_BUFSIZE];
|
||||
char *
|
||||
pg_perm_setlocale(int category, const char *locale)
|
||||
{
|
||||
char *result;
|
||||
char *result;
|
||||
const char *envvar;
|
||||
char *envbuf;
|
||||
char *envbuf;
|
||||
|
||||
#ifndef WIN32
|
||||
result = setlocale(category, locale);
|
||||
#else
|
||||
|
||||
/*
|
||||
* On Windows, setlocale(LC_MESSAGES) does not work, so just assume
|
||||
* that the given value is good and set it in the environment variables.
|
||||
* We must ignore attempts to set to "", which means "keep using the
|
||||
* old environment value".
|
||||
* On Windows, setlocale(LC_MESSAGES) does not work, so just assume that
|
||||
* the given value is good and set it in the environment variables. We
|
||||
* must ignore attempts to set to "", which means "keep using the old
|
||||
* environment value".
|
||||
*/
|
||||
#ifdef LC_MESSAGES
|
||||
if (category == LC_MESSAGES)
|
||||
@ -116,7 +118,7 @@ pg_perm_setlocale(int category, const char *locale)
|
||||
else
|
||||
#endif
|
||||
result = setlocale(category, locale);
|
||||
#endif /* WIN32 */
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (result == NULL)
|
||||
return result; /* fall out immediately on failure */
|
||||
@ -156,12 +158,13 @@ pg_perm_setlocale(int category, const char *locale)
|
||||
break;
|
||||
}
|
||||
|
||||
snprintf(envbuf, LC_ENV_BUFSIZE-1, "%s=%s", envvar, result);
|
||||
snprintf(envbuf, LC_ENV_BUFSIZE - 1, "%s=%s", envvar, result);
|
||||
|
||||
#ifndef WIN32
|
||||
if (putenv(envbuf))
|
||||
return NULL;
|
||||
#else
|
||||
|
||||
/*
|
||||
* On Windows, we need to modify both the process environment and the
|
||||
* cached version in msvcrt
|
||||
@ -251,8 +254,8 @@ locale_messages_assign(const char *value, bool doit, GucSource source)
|
||||
/*
|
||||
* LC_MESSAGES category does not exist everywhere, but accept it anyway
|
||||
*
|
||||
* On Windows, we can't even check the value, so the non-doit case
|
||||
* is a no-op
|
||||
* On Windows, we can't even check the value, so the non-doit case is a
|
||||
* no-op
|
||||
*/
|
||||
#ifdef LC_MESSAGES
|
||||
if (doit)
|
||||
|
Reference in New Issue
Block a user