From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25578 invoked from network); 16 Mar 2004 18:06:28 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 16 Mar 2004 18:06:28 -0000 Received: (qmail 7076 invoked by alias); 16 Mar 2004 18:06:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19634 Received: (qmail 7011 invoked from network); 16 Mar 2004 18:06:14 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 16 Mar 2004 18:06:14 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 16 Mar 2004 18:6:14 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-20.tower-36.messagelabs.com!1079460373!4701246 X-StarScan-Version: 5.2.5; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 2529 invoked from network); 16 Mar 2004 18:06:13 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-20.tower-36.messagelabs.com with SMTP; 16 Mar 2004 18:06:13 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i2GI6DCk029744; Tue, 16 Mar 2004 18:06:13 GMT Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id B6C1479721C1; Tue, 16 Mar 2004 19:05:28 +0100 (CET) Cc: zsh-workers@sunsite.dk X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20040316152006.GA21815@scowler.net> From: Oliver Kiddle References: <1040316145551.ZM8418@candle.brasslantern.com> <20040316150753.GA21121@scowler.net> <20040316152006.GA21815@scowler.net> To: Clint Adams Subject: Re: (Fwd) segfault with pcre_study alone Date: Tue, 16 Mar 2004 19:05:28 +0100 Message-ID: <11530.1079460328@trentino.logica.co.uk> Clint Adams wrote: > + > + if (pcre_pattern == NULL) > + { > + zwarnnam(nam, "no pattern has been compiled for study: %s", > + pcre_error, 0); > + return 1; > + } 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); Also, shouldn't you initialise pcre_pattern to NULL where it is declared since we are now relying on the compiler to initialise it to null by doing this. It might also be nice to put the same if statement in pcre_match: "error in fullinfo" is not the most helpful error message. Are you aware that zsh modules can define condition codes that can be used inside [[ ... ]]? The completion module defines a -prefix condition for example. This could be much nicer than the current interface which is just a mapping onto the C calls. We'd be able to do: if [[ value -pcre-anchored pattern ]]; then Oliver