From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17363 invoked from network); 11 Mar 2004 16:31:30 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 11 Mar 2004 16:31:30 -0000 Received: (qmail 18906 invoked by alias); 11 Mar 2004 16:31:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19601 Received: (qmail 18895 invoked from network); 11 Mar 2004 16:31:22 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 11 Mar 2004 16:31:22 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [216.254.112.45] by sunsite.dk (MessageWall 1.0.8) with SMTP; 11 Mar 2004 16:31:22 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id C5D987004A; Thu, 11 Mar 2004 11:31:21 -0500 (EST) Date: Thu, 11 Mar 2004 11:31:21 -0500 From: Clint Adams To: zsh-workers@sunsite.dk, 175467@bugs.debian.org Subject: Re: zsh -n and modules Message-ID: <20040311163121.GA30575@scowler.net> References: <20030105201312.GA2058@dman.com> <1030105223531.ZM4130@candle.brasslantern.com> <20030106001942.GA8996@dman.com> <1030106020240.ZM4262@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1030106020240.ZM4262@candle.brasslantern.com> User-Agent: Mutt/1.5.5.1+cvs20040105i > OK, so the problem is that `zsh -n' is executing math expressions. It > should probably treat math expressions just like any other builtin or > command when the -n option is present; that is, do not execute them. Is this the right place to fix this? Index: Src/subst.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/subst.c,v retrieving revision 1.36 diff -u -r1.36 subst.c --- Src/subst.c 30 Aug 2003 19:12:18 -0000 1.36 +++ Src/subst.c 11 Mar 2004 16:20:38 -0000 @@ -168,7 +168,11 @@ if (endchar == Outpar && str2[1] == '(' && str[-2] == ')') { /* Math substitution of the form $((...)) */ str[-2] = '\0'; - str = arithsubst(str2 + 2, &str3, str); + if (isset(EXECOPT)) { + str = arithsubst(str2 + 2, &str3, str); + } else { + strncpy(str3, str2, 1); + } setdata(node, (void *) str3); continue; }