if we read an utf-8 BOM, enable the utf8-hack flag (we can test for that on

mirbsd even because the main.c enabling is only run for interactive shells)
This commit is contained in:
tg
2007-04-15 12:28:38 +00:00
parent 2785ce3de4
commit 680e8ebd3f
3 changed files with 18 additions and 5 deletions

3
lex.c
View File

@@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.27 2007/04/15 10:45:58 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.28 2007/04/15 12:28:38 tg Exp $");
/* Structure to keep track of the lexing state and the various pieces of info
* needed for each particular state. */
@@ -957,6 +957,7 @@ getsc__(void)
(((const unsigned char *)(s->str))[0] == 0xBB) &&
(((const unsigned char *)(s->str))[1] == 0xBF)) {
s->str += 2;
Flag(FUTFHACK) = 1;
goto getsc_again;
}
}