Skip to content

Commit

Permalink
Disable SHOPT_BASH macro by default
Browse files Browse the repository at this point in the history
SHOPT_BASH macro was disabled by default in ksh93u release, so keep it
disabled.

Related: #238
  • Loading branch information
siteshwar committed Jun 25, 2018
1 parent 0a72c11 commit af9cabe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/cmd/ksh93/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ shared_c_args += [
'-D_BLD_shell',
'-DERROR_CONTEXT_T=Error_context_t',
'-DKSHELL',
'-DSHOPT_BASH',
'-DSHOPT_COSHELL',
'-DREAD_TIMEOUT=' + '@0@'.format(get_option('read-timeout')),
'-DAUDIT_FILE=' + '"@0@"'.format(get_option('audit-file')),
Expand Down
5 changes: 5 additions & 0 deletions src/cmd/ksh93/sh/bash.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* David Korn <dgkorn@gmail.com> *
* *
***********************************************************************/

#ifdef SHOPT_BASH

//
// Bash specific extensions.
// Originally provided by Karsten Fleischer.
Expand Down Expand Up @@ -415,3 +418,5 @@ void bash_init(Shell_t *shp, int mode) {
if (xtrace) sh_offoption(shp, SH_XTRACE);
if (verbose) sh_offoption(shp, SH_VERBOSE);
}

#endif // SHOPT_BASH
1 change: 1 addition & 0 deletions src/cmd/ksh93/sh/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ksh93_files += [
'sh/timers.c', 'sh/trestore.c', 'sh/waitevent.c', 'sh/xec.c'
]


shcomp_files += [
'sh/args.c', 'sh/arith.c', 'sh/array.c', 'sh/defs.c', 'sh/deparse.c',
'sh/env.c', 'sh/expand.c', 'sh/fault.c', 'sh/fcin.c', 'sh/init.c',
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/ksh93/sh/xec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1745,13 +1745,15 @@ int sh_exec(Shell_t *shp, const Shnode_t *t, int flags) {
sh_redirect(shp, t->fork.forkio, execflg);
(t->fork.forktre)->tre.tretyp |= t->tre.tretyp & FSHOWME;
t = t->fork.forktre;
#ifdef SHOPT_BASH
if ((t->tre.tretyp & COMMSK) == TCOM && sh_isoption(shp, SH_BASH) &&
!sh_isoption(shp, SH_LASTPIPE)) {
Shnode_t *tt = (Shnode_t *)stkalloc(shp->stk, sizeof(Shnode_t));
tt->par.partyp = type = TPAR;
tt->par.partre = (Shnode_t *)t;
t = tt;
}
#endif
sh_exec(shp, t, flags & ~simple);
} else {
sfsync(shp->outpool);
Expand Down

0 comments on commit af9cabe

Please sign in to comment.