env: -u option fails due to typo
authorRon Yorston <rmy@pobox.com>
Mon, 25 Dec 2017 20:36:05 +0000 (21:36 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 25 Dec 2017 20:36:05 +0000 (21:36 +0100)
The -u option is supposed to be allowed to appear multiple times; the
option string supplied to getopt32long requires it to be followed by a
nonnegative integer.

Reported-by: Keith Maxwell <keith.maxwell@gmail.com>
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/env.c

index 20453e871e138bac633d56ac9648b5210fc15ff9..0aebead1b07b3f772ecdbc88b89d40278be4d296 100644 (file)
@@ -54,7 +54,7 @@ int env_main(int argc UNUSED_PARAM, char **argv)
        unsigned opts;
        llist_t *unset_env = NULL;
 
-       opts = getopt32long(argv, "+iu:+",
+       opts = getopt32long(argv, "+iu:*",
                        "ignore-environment\0" No_argument       "i"
                        "unset\0"              Required_argument "u"
                        , &unset_env