1
0
Fork 0
mirror of git://slackware.nl/current.git synced 2025-01-14 08:01:11 +01:00
slackware-current/source/ap/ksh93/patches/ksh-20120801-fd2lost.patch
Patrick J Volkerding d31c50870d Slackware 14.2
Thu Jun 30 20:26:57 UTC 2016
Slackware 14.2 x86_64 stable is released!

The long development cycle (the Linux community has lately been living in
"interesting times", as they say) is finally behind us, and we're proud to
announce the release of Slackware 14.2.  The new release brings many updates
and modern tools, has switched from udev to eudev (no systemd), and adds
well over a hundred new packages to the system.  Thanks to the team, the
upstream developers, the dedicated Slackware community, and everyone else
who pitched in to help make this release a reality.

The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided
32-bit/64-bit x86/x86_64 DVD.  Please consider supporting the Slackware
project by picking up a copy from store.slackware.com.  We're taking
pre-orders now, and offer a discount if you sign up for a subscription.

Have fun!  :-)
2018-05-31 23:31:18 +02:00

64 lines
2.3 KiB
Diff

diff -up ksh-20120801/src/cmd/ksh93/sh/macro.c.orig ksh-20120801/src/cmd/ksh93/sh/macro.c
--- ksh-20120801/src/cmd/ksh93/sh/macro.c.orig 2013-12-09 13:13:22.153525239 +0100
+++ ksh-20120801/src/cmd/ksh93/sh/macro.c 2013-12-09 13:20:58.144635385 +0100
@@ -391,7 +391,7 @@ void sh_machere(Shell_t *shp,Sfio_t *inf
break;
}
case S_PAR:
- comsubst(mp,(Shnode_t*)0,1);
+ comsubst(mp,(Shnode_t*)0,3);
break;
case S_EOF:
if((c=fcfill()) > 0)
@@ -1165,7 +1165,7 @@ retry1:
case S_PAR:
if(type)
goto nosub;
- comsubst(mp,(Shnode_t*)0,1);
+ comsubst(mp,(Shnode_t*)0,3);
return(1);
case S_DIG:
var = 0;
@@ -2152,10 +2152,12 @@ static void comsubst(Mac_t *mp,register
mp->ifsp = nv_getval(np);
stkset(stkp,savptr,savtop);
newlines = 0;
- if(type/*==3 - don't break `` vs $() */ && mp->shp->spid)
+ if(type==3 && mp->shp->spid)
{
job_wait(mp->shp->spid);
- mp->shp->spid = 0;
+ if(mp->shp->pipepid==mp->shp->spid)
+ mp->shp->spid = 0;
+ mp->shp->pipepid = 0;
}
sfsetbuf(sp,(void*)sp,0);
bufsize = sfvalue(sp);
diff -up ksh-20120801/src/cmd/ksh93/sh/subshell.c.anotherfix ksh-20120801/src/cmd/ksh93/sh/subshell.c
--- ksh-20120801/src/cmd/ksh93/sh/subshell.c.anotherfix 2014-01-20 14:43:46.410416327 +0100
+++ ksh-20120801/src/cmd/ksh93/sh/subshell.c 2014-01-20 14:43:46.444416042 +0100
@@ -122,7 +122,8 @@ void sh_subtmpfile(Shell_t *shp)
else if(errno!=EBADF)
errormsg(SH_DICT,ERROR_system(1),e_toomany);
/* popping a discipline forces a /tmp file create */
- sfdisc(sfstdout,SF_POPDISC);
+ if(shp->comsub != 1)
+ sfdisc(sfstdout,SF_POPDISC);
if((fd=sffileno(sfstdout))<0)
{
/* unable to create the /tmp file so use a pipe */
diff -up ksh-20120801/src/cmd/ksh93/sh/xec.c.anotherfix ksh-20120801/src/cmd/ksh93/sh/xec.c
--- ksh-20120801/src/cmd/ksh93/sh/xec.c.anotherfix 2014-01-20 14:47:30.527524008 +0100
+++ ksh-20120801/src/cmd/ksh93/sh/xec.c 2014-01-20 14:47:30.563523703 +0100
@@ -1773,7 +1773,11 @@ int sh_exec(register const Shnode_t *t,
if(shp->pipepid)
shp->pipepid = parent;
else
+ {
job_wait(parent);
+ if(parent==shp->spid)
+ shp->spid = 0;
+ }
if(shp->topfd > topfd)
sh_iorestore(shp,topfd,0);
if(usepipe && tsetio && subdup && unpipe)