handle the "-s" command line option that POSIX requires
authorMike Frysinger <vapier@gentoo.org>
Sat, 28 Mar 2009 13:02:11 +0000 (13:02 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 28 Mar 2009 13:02:11 +0000 (13:02 -0000)
shell/hush.c

index 65babdfc12e8e325c0cc0771d15288bbf10718d7..2dd59bbb47fe413a3d9fd5d2aa8c7eeef4ffb7d6 100644 (file)
@@ -4238,7 +4238,8 @@ int hush_main(int argc, char **argv)
        }
        input = stdin;
 
-       while ((opt = getopt(argc, argv, "c:xin")) > 0) {
+       /* http://www.opengroup.org/onlinepubs/9699919799/utilities/sh.html */
+       while ((opt = getopt(argc, argv, "c:xins")) > 0) {
                switch (opt) {
                case 'c':
                        G.global_argv = argv + optind;
@@ -4258,6 +4259,10 @@ int hush_main(int argc, char **argv)
                case 'n':
                        G.fake_mode = 1;
                        break;
+               case 's':
+                       /* "-s" means "read from stdin", but this is how we always
+                        * operate, so simply do nothing here. */
+                       break;
                default:
 #ifndef BB_VER
                        fprintf(stderr, "Usage: sh [FILE]...\n"