ksh/ksh-20140415-hokaido.patch
Michal Hlavinka ebf9b31727 fix segfault in job list code
- do not resend signal on termination (#1092132)
- fix brace expansion on/off
- fix incorrect rounding of numsers 0.5 < |x| <1.0 in printf (#1080940)
- fix parser errors related to the end of the here-document marker
- ksh hangs when command substitution fills out the pipe buffer
- using typeset -l with a restricted variabled caused segmentation fault
- monitor mode was documented incorrectly
- do not crash when unsetting running function from another one (#1105139)
- should report an error when trying to cd into directory without execution bit
- job locking mechanism did not survive compiler optimization
- reading a file via command substitution did not work when any of stdin,
  stdout or stderr were closed (#1070308)
- fix lexical parser crash
2014-07-24 13:13:05 +02:00

27 lines
897 B
Diff

diff -up ksh-20140415/src/cmd/ksh93/sh/subshell.c.hokaido ksh-20140415/src/cmd/ksh93/sh/subshell.c
diff -up ksh-20140415/src/cmd/ksh93/sh/xec.c.hokaido ksh-20140415/src/cmd/ksh93/sh/xec.c
--- ksh-20140415/src/cmd/ksh93/sh/xec.c.hokaido 2014-03-17 22:13:55.000000000 +0100
+++ ksh-20140415/src/cmd/ksh93/sh/xec.c 2014-05-20 18:23:49.712532290 +0200
@@ -1630,12 +1630,20 @@ tryagain:
#endif /* SHOPT_COSHELL */
if(shp->subshell)
{
+ int comsubsave = shp->comsub;
+ if(comsubsave==1)
+ shp->comsub = 2;
sh_subtmpfile(shp);
+ shp->comsub = comsubsave;
+ if(shp->comsub==1 && !(shp->fdstatus[1]&IONOSEEK))
+ unpipe = iousepipe(shp);
+
if((type&(FAMP|TFORK))==(FAMP|TFORK))
{
if(shp->comsub && !(shp->fdstatus[1]&IONOSEEK))
{
- unpipe = iousepipe(shp);
+ if (!unpipe)
+ unpipe = iousepipe(shp);
sh_subfork();
}
}