Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh -n and modules
- X-seq: zsh-workers 19601
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx, 175467@xxxxxxxxxxxxxxx
- Subject: Re: zsh -n and modules
- Date: Thu, 11 Mar 2004 11:31:21 -0500
- In-reply-to: <1030106020240.ZM4262@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20030105201312.GA2058@xxxxxxxx> <1030105223531.ZM4130@xxxxxxxxxxxxxxxxxxxxxxx> <20030106001942.GA8996@xxxxxxxx> <1030106020240.ZM4262@xxxxxxxxxxxxxxxxxxxxxxx>
> 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;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author