aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
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 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;
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