zsh-workers
 help / color / mirror / code / Atom feed
* More incmdpos stuff Re: Crash Re: Trial for 5.0.7
@ 2014-10-03 11:47 Mikael Magnusson
  2014-10-03 12:27 ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Mikael Magnusson @ 2014-10-03 11:47 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh workers

On 3 October 2014 10:58, Peter Stephenson <p.stephenson@samsung.com> wrote:
> On Thu, 02 Oct 2014 21:58:56 -0700
> Bart Schaefer <schaefer@brasslantern.com> 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);


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-03 15:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-03 11:47 More incmdpos stuff Re: Crash Re: Trial for 5.0.7 Mikael Magnusson
2014-10-03 12:27 ` Peter Stephenson
2014-10-03 14:50   ` More crash " Bart Schaefer
2014-10-03 15:15     ` Peter Stephenson
2014-10-03 15:33       ` Bart Schaefer
2014-10-03 15:42         ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).