Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [bug] type -m '^foo'
- X-seq: zsh-workers 20440
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: [bug] type -m '^foo'
- Date: Fri, 1 Oct 2004 19:17:20 -0700 (PDT)
- In-reply-to: <200410011822.i91IMxeM009020@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20041001145038.GB1772@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <Pine.LNX.4.61.0410010954510.17173@xxxxxxxxxxxxxxxxxx> <200410011822.i91IMxeM009020@xxxxxxxxxxxxxx>
- Reply-to: zsh-workers@xxxxxxxxxx
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