Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [bug] type -m '^foo'
- X-seq: zsh-workers 20432
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Stephane Chazelas <Stephane.Chazelas@xxxxxxxxx>
- Subject: Re: [bug] type -m '^foo'
- Date: Fri, 1 Oct 2004 09:56:13 -0700 (PDT)
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <20041001145038.GB1772@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20041001145038.GB1772@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: zsh-workers@xxxxxxxxxx
On Fri, 1 Oct 2004, Stephane Chazelas wrote:
> With latest CVS version as well as 4.2.0
>
> $ type -m '(^a)'
>
> segfaults.
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.
Index: Src/hashtable.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/hashtable.c,v
retrieving revision 1.10
diff -c -r1.10 hashtable.c
--- Src/hashtable.c 22 Jun 2004 07:53:05 -0000 1.10
+++ Src/hashtable.c 1 Oct 2004 16:53:31 -0000
@@ -433,7 +433,7 @@
HashNode hn = st.u.u;
st.u.u = st.u.u->next;
if ((hn->flags & flags1) + !flags1 && !(hn->flags & flags2) &&
- pattry(pprog, hn->nam)) {
+ pattry(pprog, dupstring(hn->nam))) {
scanfunc(hn, scanflags);
match++;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author