ignore the UTF-8 Byte Order Mark at the beginning of the input (via a file

given to execute, standard input (interactive or not), via -c command line
argument, or after “eval”, but not for $(…) comsubs, at the beginning of a
subsequent line, or within a line, etc.); regression test for it

idea during my “week off” (despite the pain), bsiegert@ thinks it's good –
and utf-8 capable tools ought to be able to do this anyway
This commit is contained in:
tg
2007-04-15 10:45:59 +00:00
parent 67addd064f
commit 1692a6da66
4 changed files with 66 additions and 6 deletions

4
main.c
View File

@@ -13,7 +13,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.73 2007/03/04 03:04:26 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.74 2007/04/15 10:45:59 tg Exp $");
extern char **environ;
@@ -457,6 +457,8 @@ shell(Source * volatile s, volatile int toplevel)
Source *volatile old_source = source;
int i;
s->flags |= SF_FIRST; /* enable UTF-8 BOM check */
newenv(E_PARSE);
if (interactive)
really_exit = 0;