aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pg_locale.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2006-10-04 00:30:14 +0000
committerBruce Momjian <bruce@momjian.us>2006-10-04 00:30:14 +0000
commitf99a569a2ee3763b4ae174e81250c95ca0fdcbb6 (patch)
tree76e6371fe8b347c73d7020c0bc54b9fba519dc10 /src/backend/utils/adt/pg_locale.c
parent451e419e9852cdf9d7e7cefc09d5355abb3405e9 (diff)
downloadpostgresql-f99a569a2ee3763b4ae174e81250c95ca0fdcbb6.tar.gz
postgresql-f99a569a2ee3763b4ae174e81250c95ca0fdcbb6.zip
pgindent run for 8.2.
Diffstat (limited to 'src/backend/utils/adt/pg_locale.c')
-rw-r--r--src/backend/utils/adt/pg_locale.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index aa08c7bc8d0..da81d79f392 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-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)