components/ksh93/patches/175-Bug15794787,15819673.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 18 May 2015 14:11:16 -0700
changeset 4305 90493abe0c5c
permissions -rw-r--r--
backout 17533968/17817727/17699248/17777549/18119738/18229654/16169978/18302723/16507675/18920300/18355790/19907453/18426052/20808157/20948390/20948350 - causes 21091065

--- a/src/cmd/ksh93/sh/xec.c	Thu Nov 29 22:06:17 2012
+++ b/src/cmd/ksh93/sh/xec.c	Fri Nov 30 00:45:30 2012
@@ -540,8 +540,10 @@
 	static Sfio_t *io_save;
 	volatile int traceon=0, lineno=0;
 	int binscript=shp->binscript;
+	char comsub = shp->comsub;
 	io_save = iop; /* preserve correct value across longjmp */
 	shp->binscript = 0;
+	shp->comsub = 0;
 #define SH_TOPFUN	0x8000	/* this is a temporary tksh hack */
 	if (mode & SH_TOPFUN)
 	{
@@ -581,6 +583,7 @@
 	}
 	sh_popcontext(shp,&buff);
 	shp->binscript = binscript;
+	shp->comsub = comsub;
 	if(traceon)
 		sh_onoption(SH_XTRACE);
 	if(lineno)
@@ -3281,7 +3284,8 @@
 	struct funenv fun;
 	char *fname = nv_getval(SH_FUNNAMENOD);
 	struct Level	*lp =(struct Level*)(SH_LEVELNOD->nvfun);
-	int		level, pipepid=shp->pipepid;
+	int		level, pipepid=shp->pipepid, comsub=shp->comsub;
+	shp->comsub = 0;
 	shp->pipepid = 0;
 	sh_stats(STAT_FUNCT);
 	if(!lp->hdr.disc)
@@ -3323,6 +3327,7 @@
 	lp->maxlevel = level;
 	SH_LEVELNOD->nvalue.s = lp->maxlevel;
 	shp->last_root = nv_dict(DOTSHNOD);
+	shp->comsub = comsub;
 #if 0
 	nv_putval(SH_FUNNAMENOD,shp->st.funname,NV_NOFREE);
 #else