diff options
author | stefanf <stefanf@FreeBSD.org> | 2005-09-09 21:03:34 +0000 |
---|---|---|
committer | stefanf <stefanf@FreeBSD.org> | 2005-09-09 21:03:34 +0000 |
commit | 6a55d3e0eb1c89a62971ff51f945ebc5a7902200 (patch) | |
tree | 4d2460ce448cf8ce592421b4d5e23109973bf7a8 /bin | |
parent | 37f88a86496e962627445e664dfb714bccb76fb5 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | bin/sh/var.c | 4 |
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 { |