summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2021-09-17 22:22:23 +0200
committerpgen <p.gen.progs@gmail.com>2021-09-17 22:22:23 +0200
commit8a17b5aaf4cd06463f6f6daa74337ce4f7dfc985 (patch)
tree0ac822bc7acd28da4a0e2c89c828120c61409a4e /examples
parente8de081b992174a775188f20873c3e2d2a295e73 (diff)
Apply PR#1 from h1z1 with a small correction
Diffstat (limited to 'examples')
-rw-r--r--examples/simple_menu/simple_menu.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/simple_menu/simple_menu.sh b/examples/simple_menu/simple_menu.sh
index 5752f0e..64c7a14 100644
--- a/examples/simple_menu/simple_menu.sh
+++ b/examples/simple_menu/simple_menu.sh
@@ -177,15 +177,15 @@ while true; do
# Back to the previous menu
# '''''''''''''''''''''''''
if (( ${#MENU_STACK[*]} == 1 )); then
- process_menu ${MENU_STACK[-1]}
+ process_menu ${MENU_STACK[${#MENU_STACK[*]}-1]}
else
# Unstack the newly found submenu
# '''''''''''''''''''''''''''''''
- unset MENU_STACK[-1]
+ unset MENU_STACK[${#MENU_STACK[*]}-1]
# And generate the previous menu
# ''''''''''''''''''''''''''''''
- process_menu ${MENU_STACK[-1]}
+ process_menu ${MENU_STACK[${#MENU_STACK[*]}-1]}
fi
elif [[ $SEL == ">"* ]]; then