From af5a85f3630f3d60ad7061fe32693baf78c27dcd Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 10 Oct 2010 17:51:29 +0000 Subject: 28339: backslash-newline history without HIST_LEX_WORDS 28340: assignment to range of scalar variable with multibyte characters --- Src/hist.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Src/hist.c') diff --git a/Src/hist.c b/Src/hist.c index 0eeb98fb0..e65ddb1b6 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -2365,7 +2365,7 @@ readhistfile(char *fn, int err, int readflags) */ if (inblank(*pt)) pt++; - else if (strpfx("\\\n", pt)) + else if (pt[0] == '\\' && pt[1] == '\n') pt += 2; else break; @@ -2414,8 +2414,14 @@ readhistfile(char *fn, int err, int readflags) } if (!uselex) { do { - while (inblank(*pt)) - pt++; + for (;;) { + if (inblank(*pt)) + pt++; + else if (pt[0] == '\\' && pt[1] == '\n') + pt += 2; + else + break; + } if (*pt) { if (nwordpos >= nwords) words = (short *) -- cgit 1.4.1