From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21113 invoked from network); 10 Jun 2008 08:43:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 10 Jun 2008 08:43:53 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 12980 invoked from network); 10 Jun 2008 08:43:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 10 Jun 2008 08:43:45 -0000 Received: (qmail 18492 invoked by alias); 10 Jun 2008 08:43:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25144 Received: (qmail 18476 invoked from network); 10 Jun 2008 08:43:39 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 10 Jun 2008 08:43:39 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 178218028AC3 for ; Tue, 10 Jun 2008 10:43:35 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly11d.srv.mailcontrol.com (MailControl) with ESMTP id m5A8hKNx009005 for ; Tue, 10 Jun 2008 09:43:35 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Tue, 10 Jun 2008 09:42:48 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m5A8gmUc023822 for ; Tue, 10 Jun 2008 09:42:48 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m5A8gmjf023818 for ; Tue, 10 Jun 2008 09:42:48 +0100 Message-Id: <200806100842.m5A8gmjf023818@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: "Zsh hackers list" Subject: Re: arithmetic base accepted on output but not input In-reply-to: <2d460de70806071143s5ca2eb76m25554ad081b35b21@mail.gmail.com> References: <20080514102253.GA6202@sc.homeunix.net> <20080514114312.66719731@news01> <2d460de70806071143s5ca2eb76m25554ad081b35b21@mail.gmail.com> Comments: In-reply-to "Richard Hartmann" message dated "Sat, 07 Jun 2008 20:43:50 +0200." Date: Tue, 10 Jun 2008 09:42:48 +0100 From: Peter Stephenson X-OriginalArrivalTime: 10 Jun 2008 08:42:48.0215 (UTC) FILETIME=[F5E24270:01C8CAD5] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.68.0.121 X-Virus-Scanned: ClamAV 0.92.1/7417/Tue Jun 10 03:14:29 2008 on bifrost X-Virus-Status: Clean "Richard Hartmann" wrote: > On Wed, May 14, 2008 at 12:43 PM, Peter Stephenson wrote: > > > + if (pm->base < 2 || pm->base > 36) { > > + zwarnnam(name, "invalid base: %d", pm->base); > > + return 1; > > + } > > Could you make the error messages state what range, i.e. 2 to 36, > is allowed, please? Verbose error messages are a great thing :) OK Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.195 diff -u -r1.195 builtin.c --- Src/builtin.c 15 May 2008 15:51:01 -0000 1.195 +++ Src/builtin.c 10 Jun 2008 08:41:28 -0000 @@ -1745,7 +1745,8 @@ return 1; } if (pm->base < 2 || pm->base > 36) { - zwarnnam(name, "invalid base: %d", pm->base); + zwarnnam(name, "invalid base (must be 2 to 36 inclusive): %d", + pm->base); return 1; } } else if (always) Index: Src/math.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/math.c,v retrieving revision 1.31 diff -u -r1.31 math.c --- Src/math.c 14 May 2008 10:48:28 -0000 1.31 +++ Src/math.c 10 Jun 2008 08:41:28 -0000 @@ -461,7 +461,8 @@ if(*ptr != ']') goto bofs; if (outputradix < 2 || outputradix > 36) { - zerr("invalid base: %d", outputradix); + zerr("invalid base (must be 2 to 36 inclusive): %d", + outputradix); return EOI; } ptr++; Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.193 diff -u -r1.193 utils.c --- Src/utils.c 17 May 2008 22:43:27 -0000 1.193 +++ Src/utils.c 10 Jun 2008 08:41:28 -0000 @@ -1844,7 +1844,7 @@ } inp = s; if (base < 2 || base > 36) { - zerr("invalid base: %d", base); + zerr("invalid base (must be 2 to 36 inclusive): %d", base); return (zlong)0; } else if (base <= 10) for (; *s >= '0' && *s < ('0' + base); s++) { -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070