Skip to content

Commit

Permalink
env.sh: fix var substitution issue
Browse files Browse the repository at this point in the history
the issue was when using a number of parameter greater than 9. For
example, to evaluate the 10th param, the substution was $10, but this
was interpreted as $1 + 0, so the issue radare20. Using ${10} should fix
the issue.
  • Loading branch information
ret2libc authored and radare committed Feb 22, 2016
1 parent 3e1590f commit 6ef4f37
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,16 @@ if [ -z "$*" ]; then
echo "==> Back to system shell..."
echo
else
s='$'
if [ "$#" -gt 1 ]; then
par=""
p=0
while : ; do
p=$(($p+1))
[ $p -gt $# ] && break
a=`eval echo "$s$p"`
a=`eval echo "\$\{$p\}"`
par="$par$a "
done
eval $new_env $par "\"\$$#\""
eval $new_env $par "\"\${$#}\""
else
eval $new_env $*
fi
Expand Down

0 comments on commit 6ef4f37

Please sign in to comment.