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

Re: [bug] type -m '^foo'



On Fri, 1 Oct 2004, Peter Stephenson wrote:

> > This fixes the crash, but it would be better if pattry() could be 
> > rewritten so as not to need to modify the string in place.
> 
> I think this fixes it, but it's horribly complicated around there.

Hmm, well, what I meant was that it would be better if it could be re- 
written so as not to need a null terminator at that point, i.e., to do 
everything with array indices or starting/ending pointers rather than rely 
on having a nul-terminated string.  Copying and freeing the string down in 
the recursive guts of matching is probably more expensive (for certain 
patterns, although far less expensive for other patterns) than copying the 
whole string beforehand.

On the other hand the code is already doing zshcalloc() in that vicinity,
so perhaps a few more allocs/frees is not enough to worry about.



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