From c0e5c0935147dee44b4b7e476275b350bf86b87c Mon Sep 17 00:00:00 2001 From: tg Date: Thu, 26 Apr 2007 11:58:53 +0000 Subject: [PATCH] =?UTF-8?q?optimisation:=20#ifdef=20MKSH=5FASSUME=5FUTF8,?= =?UTF-8?q?=20don't=20bother=20to=20=E2=80=9CFlag(FUTFHACK)=20=3D=201;?= =?UTF-8?q?=E2=80=9D=20on=20UTF-8=20BOM=20encounter,=20it's=20always=20on?= =?UTF-8?q?=20(unless=20manually=20set=20to=20off)=20=E2=80=93=20saves=20a?= =?UTF-8?q?=20few=20bytes,=20I=20guess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lex.c b/lex.c index 45b8e09..8a00379 100644 --- a/lex.c +++ b/lex.c @@ -2,7 +2,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.28 2007/04/15 12:28:38 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.29 2007/04/26 11:58:53 tg Exp $"); /* Structure to keep track of the lexing state and the various pieces of info * needed for each particular state. */ @@ -957,7 +957,9 @@ 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 */ Flag(FUTFHACK) = 1; +#endif goto getsc_again; } }