Skip to content

Commit 1e2ad96

Browse files
rousonzbeekman
authored andcommitted
stack.sh fixes for use with bash3boilerplate
1 parent aa09aef commit 1e2ad96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prerequisites/stack.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function no_such_stack
120120
# echo "Got $top"
121121
#
122122
# Modification for use with bash3boilerplate:
123-
# replaced "let _i-=1" with "(( _i-=1 ))"
123+
# replaced "let _i-=1" with "(( _i-=1 )) || true"
124124

125125
function stack_pop
126126
{
@@ -141,7 +141,7 @@ function stack_pop
141141
return 1
142142
fi
143143

144-
(( _i-=1 ))
144+
(( _i-=1 )) || true
145145
eval "$2"='$'"{_stack_$1[$_i]}"
146146
eval "unset _stack_$1[$_i]"
147147
eval "_stack_$1_i=$_i"

0 commit comments

Comments
 (0)