diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-11 00:59:36 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-11 00:59:36 +0200 |
commit | 4628945cd8d4679912f126d5f18f954210abb7d0 (patch) | |
tree | 84e44413a6c1b3035effa8279d372974d3911275 /shell/ash.c | |
parent | 11f2e99c13b42675bb65cf2cfd3e3a98f95f2cee (diff) | |
download | busybox-w32-4628945cd8d4679912f126d5f18f954210abb7d0.tar.gz busybox-w32-4628945cd8d4679912f126d5f18f954210abb7d0.tar.bz2 busybox-w32-4628945cd8d4679912f126d5f18f954210abb7d0.zip |
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 5c03f1fdc..15c7c325a 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -2099,7 +2099,9 @@ extern struct globals_var *const ash_ptr_to_globals_var; | |||
2099 | static void FAST_FUNC | 2099 | static void FAST_FUNC |
2100 | getoptsreset(const char *value) | 2100 | getoptsreset(const char *value) |
2101 | { | 2101 | { |
2102 | shellparam.optind = number(value) ?: 1; | 2102 | shellparam.optind = 1; |
2103 | if (is_number(value)) | ||
2104 | shellparam.optind = number(value) ?: 1; | ||
2103 | shellparam.optoff = -1; | 2105 | shellparam.optoff = -1; |
2104 | } | 2106 | } |
2105 | #endif | 2107 | #endif |