summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-02-22 11:27:35 +0100
committerLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-02-22 11:27:35 +0100
commit15ddac722b244930e04a66fb147289a97ce6c1ce (patch)
treeba0e789e1a327a7325a896cb1e298c283f1e33aa
parent989546be58842a9fb611fbd9ddfdb2d11cf466d3 (diff)
downloadmidipix_build-15ddac722b244930e04a66fb147289a97ce6c1ce.tar.bz2
midipix_build-15ddac722b244930e04a66fb147289a97ce6c1ce.tar.xz
subr.ex/ex_init.subr:ex_init_help(): reset OPTIND to 0 before calling getopts.
-rw-r--r--subr.ex/ex_init.subr4
1 files changed, 3 insertions, 1 deletions
diff --git a/subr.ex/ex_init.subr b/subr.ex/ex_init.subr
index e15efda8..3fb6ccec 100644
--- a/subr.ex/ex_init.subr
+++ b/subr.ex/ex_init.subr
@@ -173,7 +173,8 @@ ex_init_getopts() {
ex_init_help() {
local _eih_rstatus="${1#\$}" _eih_args_long="${2}" \
_eih_name_base="${3}" _eih_optstring="${4}" \
- _eih_arg_long="" _eih_opt="" _eih_shiftfl=0;
+ _eih_arg_long="" _eih_opt="" _eih_shiftfl=0 \
+ OPTIND;
shift 4;
while [ "${#}" -gt 0 ]; do
@@ -211,6 +212,7 @@ ex_init_help() {
;;
esac;
+ OPTIND=0;
if getopts "${_eih_optstring}" _eih_opt 2>/dev/null; then
case "${_eih_opt}" in
h)