From df54eeed2ca4823d57c2bc74fc5def7b3b4a77ae Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 27 Jan 2007 19:01:11 +0000 Subject: 23136: handle Bnulls now added in $'...' --- Src/utils.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'Src/utils.c') diff --git a/Src/utils.c b/Src/utils.c index 4aa5b0799..c0ccc6715 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -4914,23 +4914,34 @@ getkeystring(char *s, int *len, int how, int *misc) } else if (*s == Meta) *t++ = *++s ^ 32; else { - *t++ = *s; if (itok(*s)) { if (meta || control) { /* * Presumably we should be using meta or control * on the character representing the token. */ - *s = ztokens[*s - Pound]; + *t++ = ztokens[*s - Pound]; } else if (how & GETKEY_DOLLAR_QUOTE) { - /* - * We don't want to metafy this, it's a real - * token. - */ - *tdest++ = *s; + if (*s == Bnull) { + /* + * Bnull is a backslash which quotes a couple + * of special characters that always appear + * literally next. See strquote handling + * in gettokstr() in lex.c. + */ + *tdest++ = *++s; + } else { + /* + * We don't want to metafy this, it's a real + * token. + */ + *tdest++ = *s; + } continue; - } - } + } else + *t++ = *s; + } else + *t++ = *s; } if (meta == 2) { t[-1] |= 0x80; -- cgit v1.2.3