diff options
author | msmith <msmith@FreeBSD.org> | 1999-01-11 06:41:32 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1999-01-11 06:41:32 +0000 |
commit | d141889dddbf47c0830a1864cd283ada0754c6e8 (patch) | |
tree | 80abade00f02b7ec6de90f25817c052679c93375 /sys/boot | |
parent | 192ad366a1277ebc36c037b0a2b9b7bb1ea780c0 (diff) | |
download | FreeBSD-src-d141889dddbf47c0830a1864cd283ada0754c6e8.zip FreeBSD-src-d141889dddbf47c0830a1864cd283ada0754c6e8.tar.gz |
No builtin command resets getopt before using it, causing
problems in case a wrong option was given previously, and no option
is given to the next command.
PR: kern/9371
Submitted by: "Daniel C. Sobral" <dcs@newsguy.com>
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/common/commands.c | 5 | ||||
-rw-r--r-- | sys/boot/common/ls.c | 3 | ||||
-rw-r--r-- | sys/boot/common/module.c | 4 | ||||
-rw-r--r-- | sys/boot/common/pnp.c | 1 |
4 files changed, 10 insertions, 3 deletions
diff --git a/sys/boot/common/commands.c b/sys/boot/common/commands.c index 8984937..fe0eb54 100644 --- a/sys/boot/common/commands.c +++ b/sys/boot/common/commands.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: commands.c,v 1.7 1998/10/31 02:53:09 msmith Exp $ + * $Id: commands.c,v 1.8 1999/01/09 02:34:48 msmith Exp $ */ #include <stand.h> @@ -299,6 +299,7 @@ command_echo(int argc, char *argv[]) nl = 0; optind = 1; + optreset = 1; while ((ch = getopt(argc, argv, "n")) != -1) { switch(ch) { case 'n': @@ -343,6 +344,7 @@ command_read(int argc, char *argv[]) timeout = -1; prompt = NULL; optind = 1; + optreset = 1; while ((c = getopt(argc, argv, "p:t:")) != -1) { switch(c) { @@ -394,6 +396,7 @@ command_lsdev(int argc, char *argv[]) verbose = 0; optind = 1; + optreset = 1; while ((ch = getopt(argc, argv, "v")) != -1) { switch(ch) { case 'v': diff --git a/sys/boot/common/ls.c b/sys/boot/common/ls.c index 493482a7..73f8057 100644 --- a/sys/boot/common/ls.c +++ b/sys/boot/common/ls.c @@ -1,5 +1,5 @@ /* - * $Id: ls.c,v 1.5 1998/10/09 07:09:22 msmith Exp $ + * $Id: ls.c,v 1.6 1998/10/11 10:28:51 peter Exp $ * From: $NetBSD: ls.c,v 1.3 1997/06/13 13:48:47 drochner Exp $ */ @@ -70,6 +70,7 @@ command_ls(int argc, char *argv[]) fd = -1; verbose = 0; optind = 1; + optreset = 1; while ((ch = getopt(argc, argv, "l")) != -1) { switch(ch) { case 'l': diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c index 5b0d547..141a8ed 100644 --- a/sys/boot/common/module.c +++ b/sys/boot/common/module.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: module.c,v 1.5 1998/09/26 10:51:38 dfr Exp $ + * $Id: module.c,v 1.6 1998/10/09 23:12:34 peter Exp $ */ /* @@ -72,6 +72,7 @@ command_load(int argc, char *argv[]) dofile = 0; optind = 1; + optreset = 1; typestr = NULL; while ((ch = getopt(argc, argv, "t:")) != -1) { switch(ch) { @@ -133,6 +134,7 @@ command_lsmod(int argc, char *argv[]) verbose = 0; optind = 1; + optreset = 1; while ((ch = getopt(argc, argv, "v")) != -1) { switch(ch) { case 'v': diff --git a/sys/boot/common/pnp.c b/sys/boot/common/pnp.c index 56d2655..7485315 100644 --- a/sys/boot/common/pnp.c +++ b/sys/boot/common/pnp.c @@ -41,6 +41,7 @@ pnp_scan(int argc, char *argv[]) verbose = 0; optind = 1; + optreset = 1; while ((ch = getopt(argc, argv, "v")) != -1) { switch(ch) { case 'v': |