env: -u option fails due to typo

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>
This commit is contained in:
Ron Yorston 2017-12-25 21:36:05 +01:00 committed by Denys Vlasenko
parent a07fead823
commit 8d8ee910f0

View 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