From 7b6d2fd9a9ffd0caf45602a96cf09ac73ab85cf4 Mon Sep 17 00:00:00 2001 From: LucĂ­a Andrea Illanes Albornoz Date: Feb 22 2023 03:44:29 +0000 Subject: subr.ex/ex_init.subr:ex_init_getopts(): reset OPTIND to 0 before calling getopts. --- diff --git a/subr.ex/ex_init.subr b/subr.ex/ex_init.subr index 80dda79..13e0edd 100644 --- a/subr.ex/ex_init.subr +++ b/subr.ex/ex_init.subr @@ -128,6 +128,7 @@ ex_init_getopts() { ;; esac; + OPTIND=0; if getopts "${_eig_optstring}" _eig_opt; then "${_eig_fn}" opt "${_eig_rstatus}" "${_eig_opt}" "${OPTARG:-}" "${@}"; _eig_fn_rc="${?}";