aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2015-06-20 12:08:48 -0400
committerNoah Misch <noah@leadboat.com>2015-06-20 12:08:48 -0400
commit1f2a378de41bf3e516b8d2c4d65790aeefbfb89d (patch)
treecd14a0621cc9c3c2266c724fe5918443de9b0eda
parent1443a165db007462c5044ad8d03d919ac4323e6d (diff)
downloadpostgresql-1f2a378de41bf3e516b8d2c4d65790aeefbfb89d.tar.gz
postgresql-1f2a378de41bf3e516b8d2c4d65790aeefbfb89d.zip
Revert "Detect setlocale(LC_CTYPE, NULL) clobbering previous return values."
This reverts commit b76e76be460a240e99c33f6fb470dd1d5fe01a2a. The buildfarm yielded no related failures.
-rw-r--r--src/backend/utils/adt/pg_locale.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 590c7702e7b..4be735e918d 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -58,7 +58,6 @@
#include "catalog/pg_collation.h"
#include "catalog/pg_control.h"
#include "mb/pg_wchar.h"
-#include "utils/builtins.h"
#include "utils/hsearch.h"
#include "utils/memutils.h"
#include "utils/pg_locale.h"
@@ -149,7 +148,6 @@ pg_perm_setlocale(int category, const char *locale)
char *result;
const char *envvar;
char *envbuf;
- char orig_result[LC_ENV_BUFSIZE];
#ifndef WIN32
result = setlocale(category, locale);
@@ -175,7 +173,6 @@ pg_perm_setlocale(int category, const char *locale)
if (result == NULL)
return result; /* fall out immediately on failure */
- strlcpy(orig_result, result, sizeof(orig_result));
/*
* Use the right encoding in translated messages. Under ENABLE_NLS, let
@@ -234,17 +231,6 @@ pg_perm_setlocale(int category, const char *locale)
}
snprintf(envbuf, LC_ENV_BUFSIZE - 1, "%s=%s", envvar, result);
- if (strcmp(orig_result, result) != 0)
- {
- char hex[2 * LC_ENV_BUFSIZE + 1];
- unsigned hexlen;
-
- hexlen =
- hex_encode(result, Min(1 + strlen(result), LC_ENV_BUFSIZE), hex);
- hex[hexlen] = '\0';
- elog(FATAL, "setlocale() result %s clobbered to 0x%s",
- orig_result, hex);
- }
if (putenv(envbuf))
return NULL;