diff options
author | Denys Vlasenko | 2017-08-11 00:59:36 +0200 |
---|---|---|
committer | Denys Vlasenko | 2017-08-11 00:59:36 +0200 |
commit | 4628945cd8d4679912f126d5f18f954210abb7d0 (patch) | |
tree | 84e44413a6c1b3035effa8279d372974d3911275 /shell/ash.c | |
parent | 11f2e99c13b42675bb65cf2cfd3e3a98f95f2cee (diff) | |
download | busybox-4628945cd8d4679912f126d5f18f954210abb7d0.zip busybox-4628945cd8d4679912f126d5f18f954210abb7d0.tar.gz |
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>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 5c03f1f..15c7c32 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -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 |