[3.0] b9830bf Use PCRE_NOTEMPTY rather than NOTEMPTY_ATSTART, it suffices for us

Tollef Fog Heen tfheen at varnish-cache.org
Mon Apr 16 10:20:36 CEST 2012


commit b9830bfa28b60a70caae92787100c675e1c719c6
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Thu Nov 10 12:24:22 2011 +0100

    Use PCRE_NOTEMPTY rather than NOTEMPTY_ATSTART, it suffices for us

diff --git a/bin/varnishd/cache_vrt_re.c b/bin/varnishd/cache_vrt_re.c
index f2db178..ec9801a 100644
--- a/bin/varnishd/cache_vrt_re.c
+++ b/bin/varnishd/cache_vrt_re.c
@@ -144,7 +144,7 @@ VRT_regsub(const struct sess *sp, int all, const char *str, void *re,
 		if (!all)
 			break;
 		memset(&ovector, 0, sizeof(ovector));
-		options |= VRE_NOTEMPTY_ATSTART;
+		options |= VRE_NOTEMPTY;
 		i = VRE_exec(t, str, len, 0, options, ovector, 30,
 		    &params->vre_limits);
 		if (i < VRE_ERROR_NOMATCH ) {
diff --git a/include/vre.h b/include/vre.h
index 59ffeb0..a59e8d7 100644
--- a/include/vre.h
+++ b/include/vre.h
@@ -49,7 +49,7 @@ typedef struct vre vre_t;
 
 /* And those to PCRE options */
 extern const unsigned VRE_CASELESS;
-extern const unsigned VRE_NOTEMPTY_ATSTART;
+extern const unsigned VRE_NOTEMPTY;
 
 vre_t *VRE_compile(const char *, int, const char **, int *);
 int VRE_exec(const vre_t *code, const char *subject, int length,
diff --git a/lib/libvarnish/vre.c b/lib/libvarnish/vre.c
index 62da7a0..e11fa29 100644
--- a/lib/libvarnish/vre.c
+++ b/lib/libvarnish/vre.c
@@ -45,12 +45,7 @@ struct vre {
  * here.
  */
 const unsigned VRE_CASELESS = PCRE_CASELESS;
-const unsigned VRE_NOTEMPTY_ATSTART =
-#ifdef PCRE_NOTEMPTY_ATSTART
-	PCRE_NOTEMPTY_ATSTART;
-#else
-	0;
-#endif
+const unsigned VRE_NOTEMPTY = PCRE_NOTEMPTY;
 
 vre_t *
 VRE_compile(const char *pattern, int options,



More information about the varnish-commit mailing list