aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-03-28 13:02:11 +0000
committerMike Frysinger <vapier@gentoo.org>2009-03-28 13:02:11 +0000
commit19a7ea126a6f05232ee7d4b786bafab8e28a8beb (patch)
treecf116d828bfc184d9ea148cae04bec68e5b4770c
parenta71cfa8aa15b7fbc84f3d011b48b6243060c5060 (diff)
downloadbusybox-w32-19a7ea126a6f05232ee7d4b786bafab8e28a8beb.tar.gz
busybox-w32-19a7ea126a6f05232ee7d4b786bafab8e28a8beb.tar.bz2
busybox-w32-19a7ea126a6f05232ee7d4b786bafab8e28a8beb.zip
handle the "-s" command line option that POSIX requires
-rw-r--r--shell/hush.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 65babdfc1..2dd59bbb4 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -4238,7 +4238,8 @@ int hush_main(int argc, char **argv)
4238 } 4238 }
4239 input = stdin; 4239 input = stdin;
4240 4240
4241 while ((opt = getopt(argc, argv, "c:xin")) > 0) { 4241 /* http://www.opengroup.org/onlinepubs/9699919799/utilities/sh.html */
4242 while ((opt = getopt(argc, argv, "c:xins")) > 0) {
4242 switch (opt) { 4243 switch (opt) {
4243 case 'c': 4244 case 'c':
4244 G.global_argv = argv + optind; 4245 G.global_argv = argv + optind;
@@ -4258,6 +4259,10 @@ int hush_main(int argc, char **argv)
4258 case 'n': 4259 case 'n':
4259 G.fake_mode = 1; 4260 G.fake_mode = 1;
4260 break; 4261 break;
4262 case 's':
4263 /* "-s" means "read from stdin", but this is how we always
4264 * operate, so simply do nothing here. */
4265 break;
4261 default: 4266 default:
4262#ifndef BB_VER 4267#ifndef BB_VER
4263 fprintf(stderr, "Usage: sh [FILE]...\n" 4268 fprintf(stderr, "Usage: sh [FILE]...\n"