diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-17 19:44:26 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-17 19:44:26 -0500 |
commit | 08fd6ff37f71485e2fc04bc6ce07d2a483c36702 (patch) | |
tree | 51fa2da7977aad7fb44daef5622b1fdf6555f06e /src/backend/regex/regexec.c | |
parent | 06d9afa6f93ec08a45da4de7afd97bbf16738739 (diff) | |
download | postgresql-08fd6ff37f71485e2fc04bc6ce07d2a483c36702.tar.gz postgresql-08fd6ff37f71485e2fc04bc6ce07d2a483c36702.zip |
Sync regex code with Tcl 8.5.11.
Sync our regex code with upstream changes since last time we did this,
which was Tcl 8.5.0 (see commit df1e965e12cdd48c11057ee6e15346ee2b8b02f5).
There are no functional changes here; the main point is just to lay down
a commit-log marker that somebody has looked at this recently, and to do
what we can to keep the two codebases comparable.
Diffstat (limited to 'src/backend/regex/regexec.c')
-rw-r--r-- | src/backend/regex/regexec.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/backend/regex/regexec.c b/src/backend/regex/regexec.c index 7dc0ddba29e..f8e31f8f4ad 100644 --- a/src/backend/regex/regexec.c +++ b/src/backend/regex/regexec.c @@ -141,7 +141,6 @@ static int dissect(struct vars *, struct subre *, chr *, chr *); static int condissect(struct vars *, struct subre *, chr *, chr *); static int altdissect(struct vars *, struct subre *, chr *, chr *); static int cdissect(struct vars *, struct subre *, chr *, chr *); -static int ccaptdissect(struct vars *, struct subre *, chr *, chr *); static int ccondissect(struct vars *, struct subre *, chr *, chr *); static int crevdissect(struct vars *, struct subre *, chr *, chr *); static int cbrdissect(struct vars *, struct subre *, chr *, chr *); @@ -708,6 +707,8 @@ cdissect(struct vars * v, chr *begin, /* beginning of relevant substring */ chr *end) /* end of same */ { + int er; + assert(t != NULL); MDEBUG(("cdissect %ld-%ld %c\n", LOFF(begin), LOFF(end), t->op)); @@ -727,32 +728,17 @@ cdissect(struct vars * v, return ccondissect(v, t, begin, end); case '(': /* capturing */ assert(t->left != NULL && t->right == NULL); - return ccaptdissect(v, t, begin, end); + assert(t->subno > 0); + er = cdissect(v, t->left, begin, end); + if (er == REG_OKAY) + subset(v, t, begin, end); + return er; default: return REG_ASSERT; } } /* - * ccaptdissect - capture subexpression matches (with complications) - */ -static int /* regexec return code */ -ccaptdissect(struct vars * v, - struct subre * t, - chr *begin, /* beginning of relevant substring */ - chr *end) /* end of same */ -{ - int er; - - assert(t->subno > 0); - - er = cdissect(v, t->left, begin, end); - if (er == REG_OKAY) - subset(v, t, begin, end); - return er; -} - -/* * ccondissect - concatenation subexpression matches (with complications) * The retry memory stores the offset of the trial midpoint from begin, * plus 1 so that 0 uniquely means "clean slate". |