28 lines
702 B
Plaintext
28 lines
702 B
Plaintext
--- src/cmd/ksh93/edit/edit.c
|
|
+++ src/cmd/ksh93/edit/edit.c 2012-01-16 16:13:59.743144345 +0100
|
|
@@ -1670,7 +1670,7 @@ int ed_histgen(Edit_t *ep,const char *pa
|
|
History_t *hp;
|
|
off_t offset;
|
|
int ac=0,l,m,n,index1,index2;
|
|
- char *cp, **argv, **av, **ar;
|
|
+ char *cp, **argv=0, **av, **ar;
|
|
if(!(hp=ep->sh->gd->hist_ptr))
|
|
return(0);
|
|
if(*pattern=='#')
|
|
@@ -1748,8 +1748,13 @@ int ed_histgen(Edit_t *ep,const char *pa
|
|
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);
|
|
}
|
|
|