summaryrefslogtreecommitdiff
path: root/regexp.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-12-28 23:17:20 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-28 23:17:20 +0000
commit51aa200460138e2cc5ab024c9216177298546e81 (patch)
treebad90e60f10400b665d61960b8f02947b64734b6 /regexp.h
parentbb661a585caf67142a296faaea725681ffc2a2ac (diff)
downloadperl-51aa200460138e2cc5ab024c9216177298546e81.tar.gz
Eliminate prelen from struct regexp. Possibly we are hardcoding a bit
to much, as the replacement assumes that the wrapping string has exactly 1 character after the wrapped string [specifically ')']. p4raw-id: //depot/perl@32757
Diffstat (limited to 'regexp.h')
-rw-r--r--regexp.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/regexp.h b/regexp.h
index 5b58697bf1..37d92c5ccb 100644
--- a/regexp.h
+++ b/regexp.h
@@ -98,7 +98,6 @@ typedef struct regexp {
/* Information about the match that isn't often used */
- I32 prelen; /* length of precomp */
/* wrapped can't be const char*, as it is returned by sv_2pv_flags */
char *wrapped; /* wrapped version of the pattern */
I32 wraplen; /* length of wrapped */
@@ -355,7 +354,10 @@ and check for NULL.
/* For source compatibility. We used to store these explicitly. */
#define RX_PRECOMP(prog) ((prog)->wrapped + (prog)->pre_prefix)
-#define RX_PRELEN(prog) ((prog)->prelen)
+/* FIXME? Are we hardcoding too much here and constraining plugin extension
+ writers? Specifically, the value 1 assumes that the wrapped version always
+ has exactly one character at the end, a ')'. Will that always be true? */
+#define RX_PRELEN(prog) ((prog)->wraplen - (prog)->pre_prefix - 1)
#endif /* PLUGGABLE_RE_EXTENSION */