Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: fix for SEGV
- X-seq: zsh-workers 7472
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: fix for SEGV
- Date: Tue, 24 Aug 1999 14:16:18 +0200 (MET DST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Try this:
...) ./zsh -f
% setopt autocd; hash wc=/bin/wc; echo|wc
It'll give you a SEGV in `isreallycom()', trying to look at
`cn->u.name' which isn't set because for hashed commands `cn->u.cmd'
is used.
Bye
Sven
--- os/exec.c Fri Aug 20 15:18:07 1999
+++ Src/exec.c Tue Aug 24 14:12:19 1999
@@ -615,12 +615,16 @@
int
isreallycom(Cmdnam cn)
{
- char fullnam[MAXCMDLEN];
+ if (cn->flags & HASHED)
+ return 1;
+ else {
+ char fullnam[MAXCMDLEN];
- strcpy(fullnam, cn->u.name ? *(cn->u.name) : "");
- strcat(fullnam, "/");
- strcat(fullnam, cn->nam);
- return iscom(fullnam);
+ strcpy(fullnam, cn->u.name ? *(cn->u.name) : "");
+ strcat(fullnam, "/");
+ strcat(fullnam, cn->nam);
+ return iscom(fullnam);
+ }
}
/**/
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author