summaryrefslogtreecommitdiff
path: root/Src/hist.c
diff options
context:
space:
mode:
authorJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2023-06-08 15:36:31 +0900
committerJun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>2023-06-08 15:36:31 +0900
commitcd1a0a70972e717aa93c5fd6b36f476b5593c206 (patch)
tree06a1b6c39ede5c9b422aa942e6d75a09856e9662 /Src/hist.c
parent2778fc5d7a1bf974147ee7e9b116adac97e20eea (diff)
downloadzsh-cd1a0a70972e717aa93c5fd6b36f476b5593c206.tar.gz
zsh-cd1a0a70972e717aa93c5fd6b36f476b5593c206.zip
51826: correctly read metafied null character from history file
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c10
1 files changed, 8 insertions, 2 deletions
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);