From 466cb1a864d9bcb0ba227e041ab1c520b8da9368 Mon Sep 17 00:00:00 2001 From: schwarze Date: Mon, 17 Apr 2017 14:31:23 +0000 Subject: [PATCH] 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 . OK dtucker@ deraadt@ --- usr.bin/ssh/utf8.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/ssh/utf8.c b/usr.bin/ssh/utf8.c index 5172bcc847d..e14fbd5e648 100644 --- a/usr.bin/ssh/utf8.c +++ b/usr.bin/ssh/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 * @@ -52,7 +52,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, "ANSI_X3.4-1968") != 0 && strcmp(loc, "646") != 0 && + strcmp(loc, "") != 0; } static int -- 2.20.1