1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-24 04:50:27 +02:00

Fix problem with output bases in zcalc

This commit is contained in:
Peter Stephenson 2001-08-16 16:42:21 +00:00
parent 0f880152fc
commit 91ef933eb3
2 changed files with 10 additions and 2 deletions

View file

@ -135,10 +135,13 @@ while vared -cehp "${(%)ZCALCPROMPT}" line; do
# Latest value is stored as a string, because it might be floating
# point or integer --- we don't know till after the evaluation, and
# arrays always store scalars anyway.
eval "latest=\$(( $base $line ))"
#
# Since it's a string, we'd better make sure we know which
# base it's in, so don't change that until we actually print it.
eval "latest=\$(( $line ))"
argv[num++]=$latest
psvar[1]=$num
print -- $latest
print -- $(( $base $latest ))
fi
line=
done