From 6fea7f0d3c4d30ddc78db9e798a3ef9427abbc6f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 10 Oct 2010 17:26:38 +0000 Subject: 28332: backslash-newline with HIST_LEX_WORDS --- ChangeLog | 8 +++++++- Src/hist.c | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0cbb540e9..a418352fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-10-10 Peter Stephenson + + * 28332: Src/hist.c: HIST_LEX_WORDS didn't handled + backslash-newline line continuation properly. Come to think of + it, neither does the alternative. + 2010-10-08 Peter Stephenson * Ben: 28330: Completion/X/Command/_acroread: add @@ -13722,5 +13728,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5100 $ +* $Revision: 1.5101 $ ***************************************************** diff --git a/Src/hist.c b/Src/hist.c index 1c626fd76..0eeb98fb0 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -2358,8 +2358,18 @@ readhistfile(char *fn, int err, int readflags) incnode(wordnode)) { char *word = getdata(wordnode); - while (inblank(*pt)) - pt++; + for (;;) { + /* + * Not really an oddity: "\\\n" is + * removed from input as if whitespace. + */ + if (inblank(*pt)) + pt++; + else if (strpfx("\\\n", pt)) + pt += 2; + else + break; + } if (!strpfx(word, pt)) { int bad = 0; /* -- cgit 1.4.1