1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-06-14 08:08:10 +02:00

51826: correctly read metafied null character from history file

This commit is contained in:
Jun-ichi Takimoto 2023-06-08 15:36:31 +09:00
parent 2778fc5d7a
commit cd1a0a7097
2 changed files with 11 additions and 2 deletions

View file

@ -1,5 +1,8 @@
2023-06-08 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 51826: Src/hist.c: correctly handle metafied null character
when reading history file
* Stephane: 51817: Completion/BSD/Command/_rcctl: protect ':'
in _rcctl (was in 51817 but missed in commit 0577daf)

View file

@ -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);