From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27570 invoked by alias); 3 Oct 2014 11:47:43 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33342 Received: (qmail 24406 invoked from network); 3 Oct 2014 11:47:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=71kT27x2d3/YjiCWxSWGblieJlJqtm0ml3B+KPkNeIA=; b=T/+rDkdUdncpPMgo+QS3+EnkqkQklhlCyH+GleMkyiW2CAbKyLKsbxce/9CAGjsjSb e2FFrmvnTNgyfC36i5yGQA6oBUqSfbC/rtKB9bEfCLcwS8320Y2ZjxGbbvZchhvHBAF1 5CrVPl4JVBtDg5PZW8CFQAKgAhoxisA7lbuGH/y+KjWRdzDgPnzg/Gv4OKc+Vu3f0Vsw w2gZxFmA/y1n7dxjFueFzvMU73IUfGEQ38TCpATc5RCZFR6TrVTjV77v5R6omdAsa443 n+AdM8QEw/CmsRHDAR4pbSItz+HEicdTV88X2wfQpEH9v2AJVDN/oHBnZoyMC8LqHFPZ Qgsg== MIME-Version: 1.0 X-Received: by 10.50.138.194 with SMTP id qs2mr13828885igb.4.1412336845625; Fri, 03 Oct 2014 04:47:25 -0700 (PDT) Date: Fri, 3 Oct 2014 13:47:25 +0200 Message-ID: Subject: More incmdpos stuff Re: Crash Re: Trial for 5.0.7 From: Mikael Magnusson To: Peter Stephenson Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 3 October 2014 10:58, Peter Stephenson wrote: > On Thu, 02 Oct 2014 21:58:56 -0700 > Bart Schaefer wrote: >> On Oct 2, 8:33pm, Bart Schaefer wrote: >> } >> } git-bisect says this is the bad revision: >> } >> } commit 8189e12312ede991827efc6683b7ce8463deb0bf >> } >> } 32552 (updated by 32560): fix segfault when using process substitution in >> } anonymous function argument list >> } >> } Also disallow process substitution in function name position. >> >> OK, I've narrowed it down to the parse.c hunks of the patch. Remove >> just that change, and the crash on piping to an anonymous function is >> fixed, but this test fails: >> >> ./C04funcdef.ztst: starting. >> Test ./C04funcdef.ztst failed: bad status 1, expected 0 from: >> () (cat $1 $2) <(print process expanded) =(print expanded to file) >> Error output: >> (eval):1: process substitution <(print process expanded) cannot be used here >> Was testing: Process substitution with anonymous functions >> ./C04funcdef.ztst: test failed. >> >> Here's the patch to revert workers/32552 (parse.c). I haven't figured >> out why fiddling with *complex here mangles the wordcode, some help is >> appreciated. Obviously the above test needs to pass. > > (I presume that *is* an anonymous function, I'd forgotten that > functions could be defined with parentheses for the bodies. Presumably > using braces makes no difference, though?) % () ( echo hi; echo $@ ) ls hi ls --color=auto -T 0 -A -v --quoting-style=shell I thought "aha, pws recently fixed something like this so I can just look at that commit and fix it", but then I looked at the code. With shortloops set, you can also do the following; % () for a; ( echo hi; echo $a ) ls hi ls hi --color=auto hi -T hi 0 hi -A hi -v hi --quoting-style=shell % () for a ( echo hi; echo $a ) ls .cvsignore Completion META-FAQ Test config.h.in install-sh [quadruple file listing elided (why four, you say? i don't know, ls is aliased to two words, \ls $LS_OPTIONS, the second expands to 6 words.)] (This is why i don't have shortloops set, every syntax error does something random instead). The second result of actually running ls happens even without the anon function, eg just % for a ( echo hi; echo $a ) ls does it. % for a; ( echo hi; echo $a ) ls zsh: parse error near `ls' -- Mikael Magnusson ecadd(0); ecadd(0); ecadd(0);