From a6ff95d0c1b3874f27baa6dbec9699ac987c110b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 7 May 2009 16:04:21 +0000 Subject: 26954: read should pass through invalid multibyte characters --- Src/builtin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Src/builtin.c') diff --git a/Src/builtin.c b/Src/builtin.c index b715e9782..d19ad01e2 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -5546,8 +5546,12 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func)) wc = (wchar_t)c; } if (ret != MB_INCOMPLETE) { - if (ret == MB_INVALID) + if (ret == MB_INVALID) { memset(&mbs, 0, sizeof(mbs)); + /* Treat this as a single character */ + wc = (wchar_t)c; + laststart = bptr; + } /* * \ at the end of a line introduces a continuation line, * except in raw mode (-r option) -- cgit 1.4.1