ash: fix "unset OPTIND" throwing an error message

Added test was failing quite severely. Now only one subtest fails
(OPTERR=0 has no effect).

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2017-08-11 00:59:36 +02:00
parent 11f2e99c13
commit 4628945cd8
3 changed files with 112 additions and 1 deletions

View File

@ -2099,7 +2099,9 @@ extern struct globals_var *const ash_ptr_to_globals_var;
static void FAST_FUNC
getoptsreset(const char *value)
{
shellparam.optind = number(value) ?: 1;
shellparam.optind = 1;
if (is_number(value))
shellparam.optind = number(value) ?: 1;
shellparam.optoff = -1;
}
#endif