components/ksh93/patches/175-Bug15794787,15819673.patch
changeset 4268 d723f8ed85fe
parent 4266 bcfdeff915c4
child 4271 7552f305c5fb
equal deleted inserted replaced
4266:bcfdeff915c4 4268:d723f8ed85fe
     1 --- a/src/cmd/ksh93/sh/xec.c	Thu Nov 29 22:06:17 2012
       
     2 +++ b/src/cmd/ksh93/sh/xec.c	Fri Nov 30 00:45:30 2012
       
     3 @@ -540,8 +540,10 @@
       
     4  	static Sfio_t *io_save;
       
     5  	volatile int traceon=0, lineno=0;
       
     6  	int binscript=shp->binscript;
       
     7 +	char comsub = shp->comsub;
       
     8  	io_save = iop; /* preserve correct value across longjmp */
       
     9  	shp->binscript = 0;
       
    10 +	shp->comsub = 0;
       
    11  #define SH_TOPFUN	0x8000	/* this is a temporary tksh hack */
       
    12  	if (mode & SH_TOPFUN)
       
    13  	{
       
    14 @@ -581,6 +583,7 @@
       
    15  	}
       
    16  	sh_popcontext(shp,&buff);
       
    17  	shp->binscript = binscript;
       
    18 +	shp->comsub = comsub;
       
    19  	if(traceon)
       
    20  		sh_onoption(SH_XTRACE);
       
    21  	if(lineno)
       
    22 @@ -3281,7 +3284,8 @@
       
    23  	struct funenv fun;
       
    24  	char *fname = nv_getval(SH_FUNNAMENOD);
       
    25  	struct Level	*lp =(struct Level*)(SH_LEVELNOD->nvfun);
       
    26 -	int		level, pipepid=shp->pipepid;
       
    27 +	int		level, pipepid=shp->pipepid, comsub=shp->comsub;
       
    28 +	shp->comsub = 0;
       
    29  	shp->pipepid = 0;
       
    30  	sh_stats(STAT_FUNCT);
       
    31  	if(!lp->hdr.disc)
       
    32 @@ -3323,6 +3327,7 @@
       
    33  	lp->maxlevel = level;
       
    34  	SH_LEVELNOD->nvalue.s = lp->maxlevel;
       
    35  	shp->last_root = nv_dict(DOTSHNOD);
       
    36 +	shp->comsub = comsub;
       
    37  #if 0
       
    38  	nv_putval(SH_FUNNAMENOD,shp->st.funname,NV_NOFREE);
       
    39  #else