From 98307b767c106690123c83f608ab51dc461c66ae Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 14 Jun 2002 17:52:05 +0000 Subject: 17318: ${(z)...} added an extra space when the lexical analyser failed. --- Src/hist.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Src') diff --git a/Src/hist.c b/Src/hist.c index 0b9bf2c17..f1f240d3d 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -2291,7 +2291,16 @@ bufferwords(LinkList list, char *buf, int *index) } } while (tok != ENDINPUT && tok != LEXERR); if (buf && tok == LEXERR && tokstr && *tokstr) { + int plen; untokenize((p = dupstring(tokstr))); + plen = strlen(p); + /* + * Strip the space we added for lexing but which won't have + * been swallowed by the lexer because we aborted early. + * The test is paranoia. + */ + if (plen && p[plen-1] == ' ' && (plen == 1 || p[plen-2] != Meta)) + p[plen - 1] = '\0'; addlinknode(list, p); num++; } -- cgit 1.4.1