Skip to content

Commit

Permalink
edit.c: Fix history generation if there are zero arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Feb 2, 2021
1 parent 627df2b commit 69e18de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cmd/ksh93/edit/edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 69e18de

Please sign in to comment.