zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Stephane Chazelas <Stephane.Chazelas@morse.com>
Cc: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: [bug] type -m '^foo'
Date: Fri, 1 Oct 2004 09:56:13 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0410010954510.17173@toltec.zanshin.com> (raw)
In-Reply-To: <20041001145038.GB1772@frhdtmp102861.morse.corp.wan>

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++;
 	    }


  parent reply	other threads:[~2004-10-01 16:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01 14:50 Stephane Chazelas
2004-10-01 14:59 ` DervishD
2004-10-01 15:29 ` Danek Duvall
2004-10-01 15:32   ` Stephane Chazelas
2004-10-01 15:34     ` Danek Duvall
2004-10-01 16:56 ` Bart Schaefer [this message]
2004-10-01 18:22   ` Peter Stephenson
2004-10-02  2:17     ` Bart Schaefer
2004-10-04 10:32       ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0410010954510.17173@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=Stephane.Chazelas@morse.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).