diff options
author | Tom Lane | 2004-11-24 22:57:09 +0000 |
---|---|---|
committer | Tom Lane | 2004-11-24 22:57:09 +0000 |
commit | 4481737a49327cbf1e5cbcdf299c7d72ec5c743f (patch) | |
tree | 05317505d422d8f7a14e371646d4c5375c07c44f | |
parent | 854d7e1a85c8b6e8c1b5d93eb29df9a5b0679e14 (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 :-(
-rw-r--r-- | src/backend/regex/regcomp.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c index 6cb89462c9..5c89010d73 100644 --- a/src/backend/regex/regcomp.c +++ b/src/backend/regex/regcomp.c @@ -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 */ |