1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

edit.c: Fix history generation if there are zero arguments

This applies a fix from OpenSUSE:
https://build.opensuse.org/package/view_file/shells/ksh/ksh93-reg.dif
This commit is contained in:
Martijn Dekker 2021-02-02 05:24:11 +00:00
parent 627df2b19a
commit 69e18de58f

View file

@ -1762,8 +1762,13 @@ int ed_histgen(Edit_t *ep,const char *pattern)
mplast->next = mp;
mplast->next = 0;
}
ep->hlist = (Histmatch_t**)argv;
ep->hfirst = ep->hlist?ep->hlist[0]:0;
if (argv)
{
ep->hlist = (Histmatch_t**)argv;
ep->hfirst = ep->hlist?ep->hlist[0]:0;
}
else
ep->hfirst = 0;
return(ep->hmax=ac);
}