Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 7445888659893398b01d014bc633b458 > files > 27

ksh-20100621-18.el5.src.rpm

diff -up ksh-20100621/src/cmd/ksh93/sh/xec.c.testpatch ksh-20100621/src/cmd/ksh93/sh/xec.c
--- ksh-20100621/src/cmd/ksh93/sh/xec.c.testpatch	2011-10-04 16:14:42.329962705 +0200
+++ ksh-20100621/src/cmd/ksh93/sh/xec.c	2011-10-04 16:14:42.420963404 +0200
@@ -532,8 +532,10 @@ int sh_eval(register Sfio_t *iop, int mo
 	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)
 	{
@@ -573,6 +575,7 @@ int sh_eval(register Sfio_t *iop, int mo
 	}
 	sh_popcontext(&buff);
 	shp->binscript = binscript;
+	shp->comsub = comsub;
 	if(traceon)
 		sh_onoption(SH_XTRACE);
 	if(lineno)
@@ -2729,7 +2732,6 @@ int sh_funscope(int argn, char *argv[],i
 	errorpush(&buff.err,0);
 	error_info.id = argv[0];
 	shp->st.var_local = shp->var_tree;
-	jmpval = sigsetjmp(buff.buff,0);
 	if(!fun)
 	{
 		shp->st.filename = fp->node->nvalue.rp->fname;
@@ -2738,6 +2740,7 @@ int sh_funscope(int argn, char *argv[],i
 		nv_putval(SH_PATHNAMENOD,shp->st.filename,NV_NOFREE);
 		nv_putval(SH_FUNNAMENOD,shp->st.funname,NV_NOFREE);
 	}
+	jmpval = sigsetjmp(buff.buff,0);
 	if(jmpval == 0)
 	{
 		if(shp->fn_depth++ > MAXDEPTH)