summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2022-07-12 22:07:20 +0300
committerToomas Soome <tsoome@me.com>2022-07-14 10:42:39 +0300
commitaa88555e2aa3d01aff5e421451572bdfcf722282 (patch)
tree32ef5a4c4c0e8b2edfd81a160885d27b5d611b17
parent52f5ebf27fc91f1194940c2bf8a3b7da3b2793e8 (diff)
downloadillumos-joyent-aa88555e2aa3d01aff5e421451572bdfcf722282.tar.gz
14809 eeprom fails with key and key=value argument processing
Reviewed by: Robert Mustacchi <rm@fingolfin.org> Reviewed by: Alexander Eremin <aeremin@tintri.com> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/cmd/eeprom/i386/benv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/cmd/eeprom/i386/benv.c b/usr/src/cmd/eeprom/i386/benv.c
index 2119bdc3af..2e559f83d3 100644
--- a/usr/src/cmd/eeprom/i386/benv.c
+++ b/usr/src/cmd/eeprom/i386/benv.c
@@ -934,12 +934,13 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
+ optind = 0;
if (bootenv) {
int rv = 0;
if (argc == 1)
- value = argv[0];
+ value = argv[optind];
if (bootenv_print)
return (lzbe_bootenv_print(name, nvlist, stdout));
@@ -978,7 +979,7 @@ main(int argc, char **argv)
if (optind >= argc) {
print_vars(elist);
return (0);
- } else
+ } else {
while (optind < argc) {
/*
* If "-" specified, read variables from stdin;
@@ -996,6 +997,7 @@ main(int argc, char **argv)
optind++;
}
+ }
/*
* don't write benv if we are processing delayed writes since