svn commit: [25854] trunk/busybox/shell

vapier at busybox.net vapier at busybox.net
Sat Mar 28 13:02:11 UTC 2009


Author: vapier
Date: 2009-03-28 13:02:11 +0000 (Sat, 28 Mar 2009)
New Revision: 25854

Log:
handle the "-s" command line option that POSIX requires

Modified:
   trunk/busybox/shell/hush.c


Changeset:
Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2009-03-28 12:57:54 UTC (rev 25853)
+++ trunk/busybox/shell/hush.c	2009-03-28 13:02:11 UTC (rev 25854)
@@ -4238,7 +4238,8 @@
 	}
 	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 @@
 		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"



More information about the busybox-cvs mailing list