#else
# define G_x_mode 0
#endif
+ char opt_s;
#if ENABLE_HUSH_INTERACTIVE
smallint promptmode; /* 0: PS1, 1: PS2 */
#endif
int debug_indent;
#endif
struct sigaction sa;
- char optstring_buf[sizeof("eix")];
+ char optstring_buf[sizeof("eixs")];
#if BASH_EPOCH_VARS
char epoch_buf[sizeof("%lu.nnnnnn") + sizeof(long)*3];
#endif
* commands read but are not executed,
* so $- can not execute too, 'n' is never seen in $-.
*/
+ if (G.opt_s)
+ *cp++ = 's';
//TODO: show 'c' if executed via "hush -c 'CMDS'" (bash only, not ash)
-//TODO: show 's' if executed via "hush -s ARG1 ARG2", or if there were no args except options (ash does this too)
*cp = '\0';
break;
}
* PS4='+ '
*/
-
/* Initialize some more globals to non-zero values */
die_func = restore_ttypgrp_and__exit;
#endif
goto final_return;
}
+ G.opt_s = 1;
/* Up to here, shell was non-interactive. Now it may become one.
* NB: don't forget to (re)run install_special_sighandlers() as needed.