From b72a9461856ab0566bd129dab4cf32e8d1dfaf91 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 25 Apr 2005 10:18:25 +0000 Subject: Fix handling of metafied characters in trailing whitespace on read --- Src/builtin.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Src/builtin.c') diff --git a/Src/builtin.c b/Src/builtin.c index 724a6baec..09034c514 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -4747,8 +4747,17 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func)) } signal_setmask(s); } - while (bptr > buf && iwsep(bptr[-1])) - bptr--; + while (bptr > buf) { + if (bptr > buf + 1 && bptr[-2] == Meta) { + if (iwsep(bptr[-1] ^ 32)) + bptr -= 2; + else + break; + } else if (iwsep(bptr[-1])) + bptr--; + else + break; + } *bptr = '\0'; if (resettty && SHTTY != -1) settyinfo(&saveti); -- cgit 1.4.1