about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-10-10 17:26:38 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-10-10 17:26:38 +0000
commit6fea7f0d3c4d30ddc78db9e798a3ef9427abbc6f (patch)
tree9ed30cb232a3f538be263c1ce8443371545153c6
parentd234059b1c6493e5eefb6c28aa2b8a021d894d51 (diff)
downloadzsh-6fea7f0d3c4d30ddc78db9e798a3ef9427abbc6f.tar.gz
zsh-6fea7f0d3c4d30ddc78db9e798a3ef9427abbc6f.tar.xz
zsh-6fea7f0d3c4d30ddc78db9e798a3ef9427abbc6f.zip
28332: backslash-newline with HIST_LEX_WORDS
-rw-r--r--ChangeLog8
-rw-r--r--Src/hist.c14
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  <p.w.stephenson@ntlworld.com>
+
+	* 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  <pws@csr.com>
 
 	* 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;
 			/*