summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ssh/libssh/common/g11n.c
diff options
context:
space:
mode:
authorjp161948 <none@none>2006-08-28 11:34:02 -0700
committerjp161948 <none@none>2006-08-28 11:34:02 -0700
commit12fcfd5af4d13749fc322b29438543787680068b (patch)
tree8d9f841a681b8de2a30185d273947904edf5293b /usr/src/cmd/ssh/libssh/common/g11n.c
parent742e7b7f67598e6aa656a0b21427a1e017a7143e (diff)
downloadillumos-gate-12fcfd5af4d13749fc322b29438543787680068b.tar.gz
6460128 sshd changes locale from ISO8859-1 to UTF-8
6460274 scp fails sometimes if target filesystem is ZFS
Diffstat (limited to 'usr/src/cmd/ssh/libssh/common/g11n.c')
-rw-r--r--usr/src/cmd/ssh/libssh/common/g11n.c55
1 files changed, 8 insertions, 47 deletions
diff --git a/usr/src/cmd/ssh/libssh/common/g11n.c b/usr/src/cmd/ssh/libssh/common/g11n.c
index 2a8af8a46e..bf6c7e5a5a 100644
--- a/usr/src/cmd/ssh/libssh/common/g11n.c
+++ b/usr/src/cmd/ssh/libssh/common/g11n.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,7 +18,7 @@
*
* CDDL HEADER END
*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -199,10 +198,10 @@ g11n_getlocale()
(void) textdomain(TEXT_DOMAIN);
/* If the locale is not set, set it from the env vars */
- if (!setlocale(LC_CTYPE, NULL))
- (void) setlocale(LC_CTYPE, "");
+ if (!setlocale(LC_MESSAGES, NULL))
+ (void) setlocale(LC_MESSAGES, "");
- return setlocale(LC_CTYPE, NULL);
+ return setlocale(LC_MESSAGES, NULL);
}
void
@@ -221,48 +220,10 @@ g11n_setlocale(int category, const char *locale)
return;
/*
- * If <category> is bogus, setlocale() will do nothing and will
- * return NULL.
+ * If <category> is bogus, setlocale() will do nothing.
*/
- if (!setlocale(category, locale))
- return;
-
- /* If setting the locale from the environment, then we're done */
- if (!*locale)
- return;
+ (void) setlocale(category, locale);
- /*
- * If setting a locale from the <locale> argument, then set the
- * related env vars.
- */
- switch (category) {
- case LC_ALL:
- /*
- * We must not set LC_ALL environment variable here because if we
- * did it would later override any other LC_* variables that were
- * requested from the other side.
- */
- setenv("LANG", locale, 1);
- break;
- case LC_CTYPE:
- setenv("LC_CTYPE", locale, 1);
- break;
- case LC_NUMERIC:
- setenv("LC_NUMERIC", locale, 1);
- break;
- case LC_TIME:
- setenv("LC_TIME", locale, 1);
- break;
- case LC_COLLATE:
- setenv("LC_COLLATE", locale, 1);
- break;
- case LC_MONETARY:
- setenv("LC_MONETARY", locale, 1);
- break;
- case LC_MESSAGES:
- setenv("LC_MESSAGES", locale, 1);
- break;
- }
return;
}