envdir: fix "envdir with no params" case

This commit is contained in:
Denis Vlasenko 2008-08-20 22:19:27 +00:00
parent 99b4083647
commit b9c262b029

View File

@ -213,6 +213,8 @@ int chpst_main(int argc UNUSED_PARAM, char **argv)
} else { } else {
option_mask32 = opt = 0; option_mask32 = opt = 0;
argv++; argv++;
if (!*argv)
bb_show_usage();
} }
// envdir? // envdir?
@ -222,7 +224,7 @@ int chpst_main(int argc UNUSED_PARAM, char **argv)
} }
// setuidgid? // setuidgid?
if (ENABLE_SETUIDGID && applet_name[0] == 's') { if (ENABLE_SETUIDGID && applet_name[1] == 'e') {
set_user = *argv++; set_user = *argv++;
opt |= OPT_u; opt |= OPT_u;
} }