mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-05-08 08:36:17 +02:00
51739: detect invalid history word beginning
This commit is contained in:
parent
f80ad32c3f
commit
88eeade0bc
|
@ -1,3 +1,7 @@
|
||||||
|
2023-05-25 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
|
* 51739: Src/hist.c: detect invalid history word beginning.
|
||||||
|
|
||||||
2023-05-21 Oliver Kiddle <opk@zsh.org>
|
2023-05-21 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
* 51769: Src/jobs.c, Src/utils.c: fix compilation when
|
* 51769: Src/jobs.c, Src/utils.c: fix compilation when
|
||||||
|
|
|
@ -1643,12 +1643,17 @@ hend(Eprog prog)
|
||||||
void
|
void
|
||||||
ihwbegin(int offset)
|
ihwbegin(int offset)
|
||||||
{
|
{
|
||||||
|
int pos = hptr - chline + offset;
|
||||||
if (stophist == 2 || (histactive & HA_INWORD) ||
|
if (stophist == 2 || (histactive & HA_INWORD) ||
|
||||||
(inbufflags & (INP_ALIAS|INP_HIST)) == INP_ALIAS)
|
(inbufflags & (INP_ALIAS|INP_HIST)) == INP_ALIAS)
|
||||||
return;
|
return;
|
||||||
if (chwordpos%2)
|
if (chwordpos%2)
|
||||||
chwordpos--; /* make sure we're on a word start, not end */
|
chwordpos--; /* make sure we're on a word start, not end */
|
||||||
chwords[chwordpos++] = hptr - chline + offset;
|
DPUTS1(pos < 0, "History word position < 0 in %s",
|
||||||
|
dupstrpfx(chline, hptr-chline));
|
||||||
|
if (pos < 0)
|
||||||
|
pos = 0;
|
||||||
|
chwords[chwordpos++] = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Abort current history word, not needed */
|
/* Abort current history word, not needed */
|
||||||
|
|
Loading…
Reference in New Issue