diff --git a/src/cmd/ksh93/include/defs.h b/src/cmd/ksh93/include/defs.h index 8eab62100..e4ea7d34b 100644 --- a/src/cmd/ksh93/include/defs.h +++ b/src/cmd/ksh93/include/defs.h @@ -211,8 +211,8 @@ struct shared unsigned char ignsig; /* ignored signal in subshell */ \ unsigned char lastsig; /* last signal received */ \ char pathinit; /* pathinit called from subshell */ \ - char comsub; /* set to 1 when in `` comsub, 2 when in $() comsub */ \ - char subshare; /* set when in ${..} comsub */ \ + char comsub; /* set to 1 when in `...`, 2 when in ${ ...; }, 3 when in $(...) */ \ + char subshare; /* set when comsub==2 (shared-state ${ ...; } command substitution) */ \ char toomany; /* set when out of fd's */ \ char instance; /* in set_instance */ \ char decomma; /* decimal_point=',' */ \ diff --git a/src/cmd/ksh93/include/shell.h b/src/cmd/ksh93/include/shell.h index 77d908dd0..15f32059d 100644 --- a/src/cmd/ksh93/include/shell.h +++ b/src/cmd/ksh93/include/shell.h @@ -86,7 +86,6 @@ typedef union Shnode_u Shnode_t; #define SH_GMACS 24 #define SH_EMACS 25 #define SH_PRIVILEGED 26 -#define SH_SUBSHARE 27 /* subshell shares state with parent */ #define SH_NOLOG 28 #define SH_NOTIFY 29 #define SH_DICTIONARY 30 diff --git a/src/cmd/ksh93/sh/subshell.c b/src/cmd/ksh93/sh/subshell.c index cd98deb04..51bc5aa16 100644 --- a/src/cmd/ksh93/sh/subshell.c +++ b/src/cmd/ksh93/sh/subshell.c @@ -523,7 +523,7 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_t *t, volatile int flags, int comsub) job.curpgid = 0; sp->subshare = shp->subshare; sp->comsub = shp->comsub; - shp->subshare = comsub==2 || (comsub==1 && sh_isoption(SH_SUBSHARE)); + shp->subshare = comsub==2; if(comsub) { shp->comsub = comsub;