Fix regression introduced by SVN r270954. Correct way to reset getopts

is to set OPTIND to 1, not unset it (which causes an error).

Thanks to:	jilles
This commit is contained in:
Devin Teske 2014-09-02 22:59:40 +00:00
parent 6e52173261
commit b74ae45b45
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=270989

View File

@ -2116,7 +2116,7 @@ f_dialog_init()
f_dprintf "f_dialog_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \
"$ARGV" "$GETOPTS_STDARGS"
SECURE=`set -- $ARGV
unset OPTIND
OPTIND=1
while getopts \
"$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \
flag > /dev/null; do
@ -2126,7 +2126,7 @@ f_dialog_init()
done
` # END-BACKTICK
USE_XDIALOG=`set -- $ARGV
unset OPTIND
OPTIND=1
while getopts \
"$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \
flag > /dev/null; do