summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorschwarze@openbsd.org <schwarze@openbsd.org>2017-04-17 14:31:23 +0000
committerDamien Miller <djm@mindrot.org>2017-04-18 10:17:46 +1000
commitf8500b2be599053daa05248a86a743232ec6a536 (patch)
tree6cb3ef2cd0b37dffc8b3946bce8b9b9d0716afb9 /utf8.c
parent7480dfedf8c5c93baaabef444b3def9331e86ad5 (diff)
downloadopenssh-git-f8500b2be599053daa05248a86a743232ec6a536.tar.gz
upstream commit
Recognize nl_langinfo(CODESET) return values "646" and "" as aliases for "US-ASCII", useful for different versions of NetBSD and Solaris. Found by dtucker@ and by Tom G. Christensen <tgc at jupiterrise dot com>. OK dtucker@ deraadt@ Upstream-ID: 38c2133817cbcae75c88c63599ac54228f0fa384
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/utf8.c b/utf8.c
index dead79b8..da577813 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utf8.c,v 1.5 2017/02/19 00:10:57 djm Exp $ */
+/* $OpenBSD: utf8.c,v 1.6 2017/04/17 14:31:23 schwarze Exp $ */
/*
* Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -61,7 +61,8 @@ dangerous_locale(void) {
loc = nl_langinfo(CODESET);
return strcmp(loc, "US-ASCII") != 0 && strcmp(loc, "UTF-8") != 0 &&
- strcmp(loc, "ANSI_X3.4-1968") != 0 && strcmp(loc, "646") != 0;
+ strcmp(loc, "ANSI_X3.4-1968") != 0 && strcmp(loc, "646") != 0 &&
+ strcmp(loc, "") != 0;
}
static int