Skip to content

Commit 1f2a378

Browse files
committed
Revert "Detect setlocale(LC_CTYPE, NULL) clobbering previous return values."
This reverts commit b76e76b. The buildfarm yielded no related failures.
1 parent 1443a16 commit 1f2a378

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/backend/utils/adt/pg_locale.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
#include "catalog/pg_collation.h"
5959
#include "catalog/pg_control.h"
6060
#include "mb/pg_wchar.h"
61-
#include "utils/builtins.h"
6261
#include "utils/hsearch.h"
6362
#include "utils/memutils.h"
6463
#include "utils/pg_locale.h"
@@ -149,7 +148,6 @@ pg_perm_setlocale(int category, const char *locale)
149148
char *result;
150149
const char *envvar;
151150
char *envbuf;
152-
char orig_result[LC_ENV_BUFSIZE];
153151

154152
#ifndef WIN32
155153
result = setlocale(category, locale);
@@ -175,7 +173,6 @@ pg_perm_setlocale(int category, const char *locale)
175173

176174
if (result == NULL)
177175
return result; /* fall out immediately on failure */
178-
strlcpy(orig_result, result, sizeof(orig_result));
179176

180177
/*
181178
* Use the right encoding in translated messages. Under ENABLE_NLS, let
@@ -234,17 +231,6 @@ pg_perm_setlocale(int category, const char *locale)
234231
}
235232

236233
snprintf(envbuf, LC_ENV_BUFSIZE - 1, "%s=%s", envvar, result);
237-
if (strcmp(orig_result, result) != 0)
238-
{
239-
char hex[2 * LC_ENV_BUFSIZE + 1];
240-
unsigned hexlen;
241-
242-
hexlen =
243-
hex_encode(result, Min(1 + strlen(result), LC_ENV_BUFSIZE), hex);
244-
hex[hexlen] = '\0';
245-
elog(FATAL, "setlocale() result %s clobbered to 0x%s",
246-
orig_result, hex);
247-
}
248234

249235
if (putenv(envbuf))
250236
return NULL;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy