From 6a55d3e0eb1c89a62971ff51f945ebc5a7902200 Mon Sep 17 00:00:00 2001 From: stefanf Date: Fri, 9 Sep 2005 21:03:34 +0000 Subject: - Provide a reasonable error message for `export -p var'. - Use argv rather than argptr since getopt() is used here. --- bin/sh/var.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { -- cgit v1.1