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

Re: Certain pattern causing shell to crash



On 2011-01-06 06:22:01 PM, Peter Stephenson wrote:
> Yes, I can get that.  The following is about the most simple form that
> still causes it to happen:
> 
> crashme() {
>   if [[ $1 =~ ^http:* ]]
>   then
>     url=${1#*=}
>   fi
> }
> which crashme
> 
> It appears that the code that decodes the '=~' expression (it doesn't
> happen if I turn that into '=') is causing the state to go awry, so that
> the code in the line after the "then" is being read wrongly.  It's got
> something to do with the regular expression, too; putting that in
> parentheses or otherwise quoting the "^" makes it go away, so it maybe
> related to how "^" is handled in this case.  It shouldn't be too hard to
> localise; it's a shame that the the wordcode is completely
> impenetrable.
For what it's worth, I did a git bisect, and the segfault was introduced
in d234059b1c6493e5eefb6c28aa2b8a021d894d51.  Hopefully this can be of
use to somebody more familiar with how this code works.

Thanks,
Ricky

Attachment: pgp2g3JtBLZl3.pgp
Description: PGP signature



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