summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenys Vlasenko2017-08-11 00:59:36 +0200
committerDenys Vlasenko2017-08-11 00:59:36 +0200
commit4628945cd8d4679912f126d5f18f954210abb7d0 (patch)
tree84e44413a6c1b3035effa8279d372974d3911275 /shell/ash.c
parent11f2e99c13b42675bb65cf2cfd3e3a98f95f2cee (diff)
downloadbusybox-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.c4
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