58
58
#include "catalog/pg_collation.h"
59
59
#include "catalog/pg_control.h"
60
60
#include "mb/pg_wchar.h"
61
- #include "utils/builtins.h"
62
61
#include "utils/hsearch.h"
63
62
#include "utils/memutils.h"
64
63
#include "utils/pg_locale.h"
@@ -149,7 +148,6 @@ pg_perm_setlocale(int category, const char *locale)
149
148
char * result ;
150
149
const char * envvar ;
151
150
char * envbuf ;
152
- char orig_result [LC_ENV_BUFSIZE ];
153
151
154
152
#ifndef WIN32
155
153
result = setlocale (category , locale );
@@ -175,7 +173,6 @@ pg_perm_setlocale(int category, const char *locale)
175
173
176
174
if (result == NULL )
177
175
return result ; /* fall out immediately on failure */
178
- strlcpy (orig_result , result , sizeof (orig_result ));
179
176
180
177
/*
181
178
* Use the right encoding in translated messages. Under ENABLE_NLS, let
@@ -234,17 +231,6 @@ pg_perm_setlocale(int category, const char *locale)
234
231
}
235
232
236
233
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
- }
248
234
249
235
if (putenv (envbuf ))
250
236
return NULL ;
0 commit comments