From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18727 invoked from network); 27 Aug 1999 16:04:26 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 27 Aug 1999 16:04:26 -0000 Received: (qmail 17286 invoked by alias); 27 Aug 1999 16:04:17 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7521 Received: (qmail 17278 invoked from network); 27 Aug 1999 16:04:14 -0000 From: "Bart Schaefer" Message-Id: <990827160405.ZM28115@candle.brasslantern.com> Date: Fri, 27 Aug 1999 16:04:05 +0000 In-Reply-To: <199908260716.JAA14633@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: PATCH: fix for SEGV" (Aug 26, 9:16am) References: <199908260716.JAA14633@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: fix for SEGV MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 26, 9:16am, Sven Wischnowsky wrote: } Subject: Re: PATCH: fix for SEGV } } Bart Schaefer wrote: } } > On Aug 24, 2:16pm, Sven Wischnowsky wrote: } > } Subject: PATCH: fix for SEGV } > } } > } + if (cn->flags & HASHED) } > } + return 1; } > } > Is that really the right fix? } } I wasn't sure either and was hoping for a reply. isreallycom() is used } only in one place, so we could easily move the extra test there. } } - if (hn && trycd && !isreallycom((Cmdnam)hn)) { } + if (hn && trycd && !(((Cmdnam)hn)->flags & HASHED) && } + !isreallycom((Cmdnam)hn)) { Actually, I was rather thinking more of something like this (which goes on top of 7490, which went on top of 7472): Index: exec.c =================================================================== @@ -617,9 +617,15 @@ { char fullnam[MAXCMDLEN]; - strcpy(fullnam, cn->u.name ? *(cn->u.name) : ""); - strcat(fullnam, "/"); - strcat(fullnam, cn->nam); + if (cn->flags & HASHED) + strcpy(fullnam, cn->u.cmd); + else if (!cn->u.name) + return 0; + else { + strcpy(fullnam, cn->u.name); + strcat(fullnam, "/"); + strcat(fullnam, cn->nam); + } return iscom(fullnam); } @@ -1685,8 +1691,7 @@ char *cmdarg = (char *) peekfirst(args); hn = cmdnamtab->getnode(cmdnamtab, cmdarg); - if (hn && trycd && !(((Cmdnam)hn)->flags & HASHED) && - !isreallycom((Cmdnam)hn)) { + if (hn && trycd && !isreallycom((Cmdnam)hn)) { cmdnamtab->removenode(cmdnamtab, cmdarg); cmdnamtab->freenode(hn); hn = NULL; -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com