From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5732 invoked from network); 4 Sep 2000 15:06:31 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Sep 2000 15:06:31 -0000 Received: (qmail 12747 invoked by alias); 4 Sep 2000 15:06:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12741 Received: (qmail 12740 invoked from network); 4 Sep 2000 15:06:24 -0000 Date: Mon, 04 Sep 2000 16:05:56 +0100 From: Peter Stephenson Subject: PATCH: another base output problem. To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0G0D00FIKB9W97@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT 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 Software Engineer Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070