Commit d4c4d284 authored by Tom Lane's avatar Tom Lane

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 :-(
parent 236404fc
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 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, ...@@ -589,8 +589,13 @@ makesearch(struct vars * v,
break; break;
if (b != NULL) if (b != NULL)
{ /* must be split */ { /* must be split */
s->tmp = slist; if (s->tmp == NULL)
slist = s; { /* 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, ...@@ -2226,12 +2231,12 @@ stid(struct subre * t,
size_t bufsize) size_t bufsize)
{ {
/* big enough for hex int or decimal t->retry? */ /* 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"; return "unable";
if (t->retry != 0) if (t->retry != 0)
sprintf(buf, "%d", t->retry); sprintf(buf, "%d", t->retry);
else else
sprintf(buf, "0x%x", (int) t); /* may lose bits, that's okay */ sprintf(buf, "%p", t);
return buf; return buf;
} }
#endif /* REG_DEBUG */ #endif /* REG_DEBUG */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment