diff options
author | Tom Lane | 2004-11-24 22:56:54 +0000 |
---|---|---|
committer | Tom Lane | 2004-11-24 22:56:54 +0000 |
commit | d4c4d284270947aeaa1b1b94503e071c7d8ce75f (patch) | |
tree | f73f9dc7526f2201c56a7d18c2a73851882b4e75 /src/backend/regex/regcomp.c | |
parent | 236404fcd14f189412138e29d8a78765540a0000 (diff) |
Install Tcl regex fixes to sync our regex engine with Tcl 8.4.8 (up from
8.4.1). This corrects some curious regex bugs, though not the greediness
issue I was hoping to find a solution for :-(
Diffstat (limited to 'src/backend/regex/regcomp.c')
-rw-r--r-- | src/backend/regex/regcomp.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index 9d350683fcc..cdf2683bc79 100644 --- a/src/backend/regex/regcomp.c +++ b/src/backend/regex/regcomp.c @@ -28,7 +28,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $PostgreSQL: pgsql/src/backend/regex/regcomp.c,v 1.41 2004/05/07 00:24:57 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/regex/regcomp.c,v 1.42 2004/11/24 22:56:54 tgl Exp $ * */ @@ -589,8 +589,13 @@ makesearch(struct vars * v, break; if (b != NULL) { /* must be split */ - s->tmp = slist; - slist = s; + if (s->tmp == NULL) + { /* if not already in the list */ + /* (fixes bugs 505048, 230589, */ + /* 840258, 504785) */ + s->tmp = slist; + slist = s; + } } } @@ -2226,12 +2231,12 @@ stid(struct subre * t, size_t bufsize) { /* big enough for hex int or decimal t->retry? */ - if (bufsize < sizeof(int) * 2 + 3 || bufsize < sizeof(t->retry) * 3 + 1) + if (bufsize < sizeof(void *) * 2 + 3 || bufsize < sizeof(t->retry) * 3 + 1) return "unable"; if (t->retry != 0) sprintf(buf, "%d", t->retry); else - sprintf(buf, "0x%x", (int) t); /* may lose bits, that's okay */ + sprintf(buf, "%p", t); return buf; } #endif /* REG_DEBUG */ |