Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Crash with =~ in script, but not interactively



On 04/01/2008, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> I was going to make a wrapper script that replaces the :43: in gcc
> warnings with +43 so i can open in vim easierly, but ran into some
> problems.
>
> #!/bin/zsh
> #this makes zsh segfault
> if [[ $#@ = 1 ]]; then
>         if [[ $1 =~ /?[^/]+:[0-9]+:$ ]]; then
>                 echo hello
>         fi
> fi
>
> If i save that in a file and run 'zsh file' it crashes, but if i run
> 'source file' in an open shell it works as expected. Here's a
> backtrace with -g3 -O0

Just checked, this happens directly on the commit "23375: Phil
Pennock: =~, zsh/regex etc. etc.", so the bug wasn't introduced after
that. Likely the bug is somewhere else, but I can't reproduce it with
just a = instead of the =~.

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author