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:
parent
2778fc5d7a
commit
cd1a0a7097
2 changed files with 11 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
10
Src/hist.c
10
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);
|
||||
|
|
Loading…
Reference in a new issue