Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: another one of those



Index: Src/hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/hist.c,v
retrieving revision 1.104
diff -p -u -r1.104 hist.c
--- Src/hist.c	7 Oct 2010 16:49:50 -0000	1.104
+++ Src/hist.c	8 Oct 2010 17:04:13 -0000
@@ -2358,8 +2358,18 @@ readhistfile(char *fn, int err, int read
 		     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;
 			/*

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author