Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: zparseopts causes core dump
- X-seq: zsh-workers 11360
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: zparseopts causes core dump
- Date: Mon, 15 May 2000 10:02:12 +0200 (MET DST)
- In-reply-to: Tanaka Akira's message of 14 May 2000 07:54:40 +0900
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Tanaka Akira wrote:
> zparseopts causes core dump as follows.
>
> Z(4):akr@serein% Src/zsh -f
> serein% set - -a
> serein% zparseopts -a=xxx
> zsh: segmentation fault (core dumped) Src/zsh -f
`-a=xxx' is not a option description and zparseopts should catch that
case, right.
Bye
Sven
Index: Src/Modules/zutil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zutil.c,v
retrieving revision 1.2
diff -u -r1.2 zutil.c
--- Src/Modules/zutil.c 2000/05/04 20:16:10 1.2
+++ Src/Modules/zutil.c 2000/05/15 08:00:59
@@ -1326,12 +1326,18 @@
}
break;
}
- if (!o)
+ if (!o) {
+ o = "";
break;
+ }
} else {
args--;
break;
}
+ }
+ if (!o) {
+ zwarnnam(nam, "missing option descriptions", NULL, 0);
+ return 1;
}
while ((o = dupstring(*args++))) {
if (!*o) {
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author