Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: (Fwd) segfault with pcre_study alone
- X-seq: zsh-workers 19640
- From: Clint Adams <clint@xxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: (Fwd) segfault with pcre_study alone
- Date: Tue, 16 Mar 2004 14:49:17 -0500
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <11530.1079460328@xxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <1040316145551.ZM8418@xxxxxxxxxxxxxxxxxxxxxxx> <20040316150753.GA21121@xxxxxxxxxxx> <20040316152006.GA21815@xxxxxxxxxxx> <11530.1079460328@xxxxxxxxxxxxxxxxxxxxx>
> At this point, pcre_error has been declared a char * but not assigned
> to by anything. You need:
> zwarnnam(nam, "no pattern has been compiled for study", NULL, 0);
>
> It might also be nice to put the same if statement in pcre_match:
> "error in fullinfo" is not the most helpful error message.
I think this improves those two.
Index: Src/Modules/pcre.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/pcre.c,v
retrieving revision 1.6
diff -u -r1.6 pcre.c
--- Src/Modules/pcre.c 16 Mar 2004 15:14:39 -0000 1.6
+++ Src/Modules/pcre.c 16 Mar 2004 19:39:07 -0000
@@ -74,8 +74,8 @@
if (pcre_pattern == NULL)
{
- zwarnnam(nam, "no pattern has been compiled for study: %s",
- pcre_error, 0);
+ zwarnnam(nam, "no pattern has been compiled for study",
+ NULL, 0);
return 1;
}
@@ -112,9 +112,9 @@
}
}
- if (pcre_fullinfo(pcre_pattern, pcre_hints, PCRE_INFO_CAPTURECOUNT, &capcount))
+ if (ret = pcre_fullinfo(pcre_pattern, pcre_hints, PCRE_INFO_CAPTURECOUNT, &capcount))
{
- zwarnnam(nam, "error in fullinfo", NULL, 0);
+ zwarnnam(nam, "error %d in fullinfo", NULL, ret);
return 1;
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author