# HG changeset patch # User Rob Landley # Date 1425174843 21600 # Node ID 3746a6d29d878e6eae64a9e6df133ca2ed4c6497 # Parent 27d570eee68d7f30255258d55efaf678177ec005 Minor toysh cleanup: remove another unnecessary option. diff -r 27d570eee68d -r 3746a6d29d87 toys/pending/sh.c --- a/toys/pending/sh.c Sat Feb 28 15:21:13 2015 -0600 +++ b/toys/pending/sh.c Sat Feb 28 19:54:03 2015 -0600 @@ -24,7 +24,7 @@ USE_SH(NEWTOY(cd, NULL, TOYFLAG_NOFORK)) USE_SH(NEWTOY(exit, NULL, TOYFLAG_NOFORK)) -USE_SH(NEWTOY(sh, "c:"USE_SH_INTERACTIVE("i"), TOYFLAG_BIN)) +USE_SH(NEWTOY(sh, "c:i", TOYFLAG_BIN)) USE_SH(OLDTOY(toysh, sh, TOYFLAG_BIN)) config SH @@ -37,16 +37,6 @@ and responds to it. -c command line to execute - -config SH_INTERACTIVE - bool "Interactive shell" - default n - depends on SH - help - This shell supports terminal control (so the shell isn't killed by CTRL-C), - job control (fg, bg, jobs), and reads /etc/profile and ~/.profile when - running interactively. - -i interactive mode (default when STDIN is a tty) config EXIT @@ -248,7 +238,7 @@ if (!cmdline) return 0; - if (CFG_SH_INTERACTIVE) line->cmdline = cmdline; + line->cmdline = cmdline; // Parse command into argv[] for (;;) { @@ -257,7 +247,7 @@ // Skip leading whitespace and detect end of line. while (isspace(*start)) start++; if (!*start || *start=='#') { - if (CFG_SH_INTERACTIVE) line->cmdlinelen = start-cmdline; + line->cmdlinelen = start-cmdline; return 0; } @@ -281,7 +271,7 @@ start = end; } - if (CFG_SH_INTERACTIVE) line->cmdlinelen = start-cmdline; + line->cmdlinelen = start-cmdline; return start; } @@ -375,7 +365,7 @@ FILE *f; // Set up signal handlers and grab control of this tty. - if (CFG_SH_INTERACTIVE && isatty(0)) toys.optflags |= FLAG_i; + if (isatty(0)) toys.optflags |= FLAG_i; f = *toys.optargs ? xfopen(*toys.optargs, "r") : NULL; if (TT.command) handle(TT.command);