From cd1a0a70972e717aa93c5fd6b36f476b5593c206 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Thu, 8 Jun 2023 15:36:31 +0900 Subject: 51826: correctly read metafied null character from history file --- Src/hist.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/hist.c b/Src/hist.c index b4dc53d90..bfbcd6ede 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -3803,8 +3803,14 @@ histsplitwords(char *lineptr, short **wordsp, int *nwordsp, int *nwordposp, zrealloc(words, nwords*sizeof(*words)); } words[nwordpos++] = lineptr - start; - while (*lineptr && !inblank(*lineptr)) - lineptr++; + while (*lineptr) { + if (*lineptr == Meta && lineptr[1]) + lineptr += 2; + else if (!inblank(*lineptr)) + lineptr++; + else + break; + } words[nwordpos++] = lineptr - start; } } while (*lineptr); -- cgit 1.4.1