zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: Re: zsh/pcre module causes core dump w/cvs co as of 2007-04-02
Date: Thu, 5 Apr 2007 12:16:28 -0400	[thread overview]
Message-ID: <20070405161628.GA23251@scowler.net> (raw)
In-Reply-To: <070404081343.ZM9674@torch.brasslantern.com>

On Wed, Apr 04, 2007 at 08:13:43AM -0700, Bart Schaefer wrote:
> I wouldn't think so, but I'm not sure what that was supposed to achieve.

I haven't a clue.  Maybe it'd be better to prevent the module from being
loadable at all.

Index: Src/Modules/pcre.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/pcre.c,v
retrieving revision 1.10
diff -u -r1.10 pcre.c
--- Src/Modules/pcre.c	30 May 2006 22:35:03 -0000	1.10
+++ Src/Modules/pcre.c	5 Apr 2007 16:12:59 -0000
@@ -189,13 +189,16 @@
     return 0;
 }
 
+static struct conddef cotab[] = {
+    CONDDEF("pcre-match", CONDF_INFIX, cond_pcre_match, 0, 0, CPCRE_PLAIN)
+};
+
 /**/
 #else /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */
 
 # define bin_pcre_compile bin_notavail
 # define bin_pcre_study bin_notavail
 # define bin_pcre_match bin_notavail
-# define cond_pcre_match cond_match
 
 /**/
 #endif /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */
@@ -206,10 +209,6 @@
     BUILTIN("pcre_match",   0, bin_pcre_match,   1, 2, 0, "a",    NULL)
 };
 
-static struct conddef cotab[] = {
-    CONDDEF("pcre-match", CONDF_INFIX, cond_pcre_match, 0, 0, CPCRE_PLAIN)
-};
-
 
 /**/
 int
@@ -222,8 +221,12 @@
 int
 boot_(Module m)
 {
+#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC)
     return !addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)) ||
 	   !addconddefs(m->nam, cotab, sizeof(cotab)/sizeof(*cotab));
+#else /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */
+    return !addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
+#endif /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */
 }
 
 /**/
@@ -231,7 +234,9 @@
 cleanup_(Module m)
 {
     deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
+#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC)
     deleteconddefs(m->nam, cotab, sizeof(cotab)/sizeof(*cotab));
+#endif /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */
     return 0;
 }
 


  reply	other threads:[~2007-04-05 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-03  6:00 Bart Schaefer
2007-04-04 11:45 ` Clint Adams
2007-04-04 15:13   ` Bart Schaefer
2007-04-05 16:16     ` Clint Adams [this message]
2007-04-12 10:22       ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070405161628.GA23251@scowler.net \
    --to=clint@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).