components/ksh93/patches/Bug15794787,15819673.patch
author Vladimir Marek <Vladimir.Marek@oracle.com>
Mon, 25 Nov 2013 17:42:18 +0100
branchs11u1-sru
changeset 2846 308d0c192664
parent 2544 50b56aff2479
permissions -rw-r--r--
17714341 /usr/bin/cd core dumps during string substitution
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2544
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     1
--- a/src/cmd/ksh93/sh/xec.c	Thu Nov 29 22:06:17 2012
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     2
+++ b/src/cmd/ksh93/sh/xec.c	Fri Nov 30 00:45:30 2012
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     3
@@ -540,8 +540,10 @@
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     4
 	static Sfio_t *io_save;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     5
 	volatile int traceon=0, lineno=0;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     6
 	int binscript=shp->binscript;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     7
+	char comsub = shp->comsub;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     8
 	io_save = iop; /* preserve correct value across longjmp */
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
     9
 	shp->binscript = 0;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    10
+	shp->comsub = 0;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    11
 #define SH_TOPFUN	0x8000	/* this is a temporary tksh hack */
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    12
 	if (mode & SH_TOPFUN)
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    13
 	{
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    14
@@ -581,6 +583,7 @@
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    15
 	}
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    16
 	sh_popcontext(shp,&buff);
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    17
 	shp->binscript = binscript;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    18
+	shp->comsub = comsub;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    19
 	if(traceon)
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    20
 		sh_onoption(SH_XTRACE);
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    21
 	if(lineno)
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    22
@@ -3281,7 +3284,8 @@
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    23
 	struct funenv fun;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    24
 	char *fname = nv_getval(SH_FUNNAMENOD);
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    25
 	struct Level	*lp =(struct Level*)(SH_LEVELNOD->nvfun);
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    26
-	int		level, pipepid=shp->pipepid;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    27
+	int		level, pipepid=shp->pipepid, comsub=shp->comsub;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    28
+	shp->comsub = 0;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    29
 	shp->pipepid = 0;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    30
 	sh_stats(STAT_FUNCT);
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    31
 	if(!lp->hdr.disc)
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    32
@@ -3323,6 +3327,7 @@
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    33
 	lp->maxlevel = level;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    34
 	SH_LEVELNOD->nvalue.s = lp->maxlevel;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    35
 	shp->last_root = nv_dict(DOTSHNOD);
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    36
+	shp->comsub = comsub;
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    37
 #if 0
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    38
 	nv_putval(SH_FUNNAMENOD,shp->st.funname,NV_NOFREE);
50b56aff2479 15794787 SUNBT7172653 ksh93 hangs when passing a 20481-byte file through pipe
Mohana Rao Gorai <mohana.gorai@oracle.com>
parents:
diff changeset
    39
 #else