From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: PATCH: another base output problem.
Date: Mon, 04 Sep 2000 16:05:56 +0100 [thread overview]
Message-ID: <0G0D00FIKB9W97@la-la.cambridgesiliconradio.com> (raw)
This fixes this problem:
% f=472
% print $(( [#16] f ))
472
which arose because the nested evaluation set outputradix back to zero.
The simplest fix seems to be only to reset it for a top-level math eval.
Anything more sophisticated is hard because of the fact that some inner
math evals (such as this one) are fairly well hidden.
Index: Src/math.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/math.c,v
retrieving revision 1.6
diff -u -r1.6 math.c
--- Src/math.c 2000/09/02 17:09:29 1.6
+++ Src/math.c 2000/09/04 15:01:57
@@ -959,7 +959,9 @@
char *junk;
mnumber x;
int xmtok = mtok;
- outputradix = 0;
+ /* maintain outputradix across levels of evaluation */
+ if (!mlevel)
+ outputradix = 0;
if (!*s) {
x.type = MN_INTEGER;
--
Peter Stephenson <pws@csr.com> Software Engineer
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070
reply other threads:[~2000-09-04 15:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0G0D00FIKB9W97@la-la.cambridgesiliconradio.com \
--to=pws@csr.com \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).