aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index ba116d83a..3524d046e 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -404,6 +404,7 @@ struct globals_misc {
404 uint8_t exitstatus; /* exit status of last command */ 404 uint8_t exitstatus; /* exit status of last command */
405 uint8_t back_exitstatus;/* exit status of backquoted command */ 405 uint8_t back_exitstatus;/* exit status of backquoted command */
406 smallint job_warning; /* user was warned about stopped jobs (can be 2, 1 or 0). */ 406 smallint job_warning; /* user was warned about stopped jobs (can be 2, 1 or 0). */
407 smallint inps4; /* Prevent PS4 nesting. */
407 int savestatus; /* exit status of last command outside traps */ 408 int savestatus; /* exit status of last command outside traps */
408 int rootpid; /* pid of main shell */ 409 int rootpid; /* pid of main shell */
409 /* shell level: 0 for the main shell, 1 for its children, and so on */ 410 /* shell level: 0 for the main shell, 1 for its children, and so on */
@@ -492,6 +493,7 @@ extern struct globals_misc *BB_GLOBAL_CONST ash_ptr_to_globals_misc;
492#define exitstatus (G_misc.exitstatus ) 493#define exitstatus (G_misc.exitstatus )
493#define back_exitstatus (G_misc.back_exitstatus ) 494#define back_exitstatus (G_misc.back_exitstatus )
494#define job_warning (G_misc.job_warning) 495#define job_warning (G_misc.job_warning)
496#define inps4 (G_misc.inps4 )
495#define savestatus (G_misc.savestatus ) 497#define savestatus (G_misc.savestatus )
496#define rootpid (G_misc.rootpid ) 498#define rootpid (G_misc.rootpid )
497#define shlvl (G_misc.shlvl ) 499#define shlvl (G_misc.shlvl )
@@ -10423,10 +10425,12 @@ evalcommand(union node *cmd, int flags)
10423 } 10425 }
10424 10426
10425 /* Print the command if xflag is set. */ 10427 /* Print the command if xflag is set. */
10426 if (xflag) { 10428 if (xflag && !inps4) {
10427 const char *pfx = ""; 10429 const char *pfx = "";
10428 10430
10431 inps4 = 1;
10429 fdprintf(preverrout_fd, "%s", expandstr(ps4val(), DQSYNTAX)); 10432 fdprintf(preverrout_fd, "%s", expandstr(ps4val(), DQSYNTAX));
10433 inps4 = 0;
10430 10434
10431 sp = varlist.list; 10435 sp = varlist.list;
10432 while (sp) { 10436 while (sp) {
@@ -14323,6 +14327,7 @@ exitreset(void)
14323 } 14327 }
14324 evalskip = 0; 14328 evalskip = 0;
14325 loopnest = 0; 14329 loopnest = 0;
14330 inps4 = 0;
14326 14331
14327 /* from expand.c: */ 14332 /* from expand.c: */
14328 ifsfree(); 14333 ifsfree();