summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/sh/var.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/sh/var.c b/bin/sh/var.c
index 7a77ee2..4bc1a61 100644
--- a/bin/sh/var.c
+++ b/bin/sh/var.c
@@ -541,9 +541,11 @@ exportcmd(int argc, char **argv)
argc -= optind;
argv += optind;
+ if (values && argc != 0)
+ error("-p requires no arguments");
listsetvar(cmdenviron);
if (argc != 0) {
- while ((name = *argptr++) != NULL) {
+ while ((name = *argv++) != NULL) {
if ((p = strchr(name, '=')) != NULL) {
p++;
} else {
OpenPOWER on IntegriCloud