From d2d035355f6576809e92bbd5db577d64ca4a5c18 Mon Sep 17 00:00:00 2001 From: tg Date: Thu, 10 May 2007 19:22:11 +0000 Subject: [PATCH] =?UTF-8?q?a=20certain=20size=20optimisation=20broke=20the?= =?UTF-8?q?=20utf8bom-3=20regression=20test=20if=20mksh=20was=20configured?= =?UTF-8?q?=20to=20have=20utf-8=20mode=20=E2=80=9Calways=20on=E2=80=9D=20(?= =?UTF-8?q?because=20it's=20really=20only=20always=20on=20for=20interactiv?= =?UTF-8?q?e=20shells);=20setting=20it=20to=20really=20always=20on=20would?= =?UTF-8?q?=20break=20the=20other=20half=20of=20this=20regression=20test,?= =?UTF-8?q?=20so=20do=20the=20optimisation=20only=20if=20MKSH=5FSMALL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.t | 3 ++- lex.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/check.t b/check.t index 06dbf48..aab367c 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.102 2007/05/10 19:08:47 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.103 2007/05/10 19:22:10 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 $ @@ -3955,6 +3955,7 @@ expected-stdout: name: utf8bom-3 description: Reading the UTF-8 BOM should enable the utf8-hack flag + (unless both MKSH_ASSUME_UTF8 and MKSH_SMALL are set) category: pdksh stdin: $0 -c ':; x=$(set +o); if [[ $x = *utf8* ]]; then print on; else print off; fi' diff --git a/lex.c b/lex.c index 8a00379..7403e30 100644 --- a/lex.c +++ b/lex.c @@ -2,7 +2,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.29 2007/04/26 11:58:53 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.30 2007/05/10 19:22:11 tg Exp $"); /* Structure to keep track of the lexing state and the various pieces of info * needed for each particular state. */ @@ -957,7 +957,7 @@ getsc__(void) (((const unsigned char *)(s->str))[0] == 0xBB) && (((const unsigned char *)(s->str))[1] == 0xBF)) { s->str += 2; -#ifndef MKSH_ASSUME_UTF8 /* otherwise it's always on */ +#if !defined(MKSH_ASSUME_UTF8) || !defined(MKSH_SMALL) Flag(FUTFHACK) = 1; #endif goto getsc_again;