- Provide a reasonable error message for `export -p var'.

- Use argv rather than argptr since getopt() is used here.
This commit is contained in:
Stefan Farfeleder 2005-09-09 21:03:34 +00:00
parent e4c880af3f
commit 3fda45eca8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149919

View File

@ -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 {