From 073890bc57b001cde08a63e3385813b2c88bcd3f Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 20 Apr 2008 00:28:30 +0000 Subject: [PATCH] =?UTF-8?q?this=20one=20won't=20work=20so=20well=20though?= =?UTF-8?q?=20=E2=98=B9=20I=20tried=20to=20use=20a=20subshell=20to=20try?= =?UTF-8?q?=20to=20convert,=20to=20make=20it=20more=20robust=20against=20i?= =?UTF-8?q?nvalid=20utf-8,=20but=20that=20didn't=20work=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.t | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/check.t b/check.t index c37a5b2..2e193af 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.181 2008/04/20 00:24:25 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.182 2008/04/20 00:28:30 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -4822,13 +4822,12 @@ stdin: while IFS= read -r line; do line=$line$nl while [[ -n $line ]]; do - (( hv = 1#${line::1} & 0xFF )) - if (( hv < 0xC2 )); then - n=1 - elif (( hv < 0xE0 )); then + if (integer x=1#${line::3}) 2>&-; then + n=3 + elif (integer x=1#${line::2}) 2>&-; then n=2 else - n=3 + n=1 fi wc=1#${line::n} if (( (wc < 32) || \