Skip to content

Commit

Permalink
Fix menu short-circuit loop
Browse files Browse the repository at this point in the history
  • Loading branch information
RadxaYuntian committed Oct 24, 2023
1 parent d1ec064 commit 5b07243
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/usr/lib/rsetup/mod/dialog/menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ menu_show() {
__parameter_count_check 1 "$@"

local item="0"
if (( ${#RSETUP_MENU_CALLBACK[@]} == 1 )) || \
item=$(__dialog --menu "$1" "${RSETUP_MENU[@]}" 3>&1 1>&2 2>&3 3>&-)
if (( ${#RSETUP_MENU_CALLBACK[@]} == 1 ))
then
RSETUP_MENU_SELECTED="$(menu_getitem "$item")"
switch_screen "${RSETUP_MENU_CALLBACK[$item]}"
elif item=$(__dialog --menu "$1" "${RSETUP_MENU[@]}" 3>&1 1>&2 2>&3 3>&-)
then
RSETUP_MENU_SELECTED="$(menu_getitem "$item")"
push_screen "${RSETUP_MENU_CALLBACK[$item]}"
Expand Down

0 comments on commit 5b07243

Please sign in to comment.