From 8c7c60ec19c4f37ff54c0ff4a4f178a6fcd1f213 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Thu, 16 Jul 2020 00:59:33 +0100 Subject: [PATCH] shellquoting: rm redundant iswprint() call (re: f9d28935) A regression test failure was occurring on FreeBSD for bin/shtests -u builtins because UTF-8 characters were wrongly encoded as bytes in the C.UTF-8 locale. The cause is that iswprint() always returns false on FreeBSD if the ksh-specific C.UTF-8 locale is active, as the OS doesn't support it. That iswprint() call is redundant anyway; the new is_invisible() function now handles this. src/cmd/ksh93/sh/string.c: sh_fmtq(): - Remove redundant iswprint() test. --- src/cmd/ksh93/sh/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/ksh93/sh/string.c b/src/cmd/ksh93/sh/string.c index fd620a09e..e7c102f4a 100644 --- a/src/cmd/ksh93/sh/string.c +++ b/src/cmd/ksh93/sh/string.c @@ -459,7 +459,7 @@ char *sh_fmtq(const char *string) sfprintf(staksp,"\\u[%x]",c); continue; } - else if(!iswprint(c) || isbyte) + else if(isbyte) #else if(!isprint(c)) #endif