summaryrefslogtreecommitdiffstats
path: root/bin/sh/var.c
diff options
context:
space:
mode:
authorstefanf <stefanf@FreeBSD.org>2005-09-09 21:03:34 +0000
committerstefanf <stefanf@FreeBSD.org>2005-09-09 21:03:34 +0000
commit6a55d3e0eb1c89a62971ff51f945ebc5a7902200 (patch)
tree4d2460ce448cf8ce592421b4d5e23109973bf7a8 /bin/sh/var.c
parent37f88a86496e962627445e664dfb714bccb76fb5 (diff)
downloadFreeBSD-src-6a55d3e0eb1c89a62971ff51f945ebc5a7902200.zip
FreeBSD-src-6a55d3e0eb1c89a62971ff51f945ebc5a7902200.tar.gz
- Provide a reasonable error message for `export -p var'.
- Use argv rather than argptr since getopt() is used here.
Diffstat (limited to 'bin/sh/var.c')
-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