Skip to content

Commit d4c4d28

Browse files
committed
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 :-(
1 parent 236404f commit d4c4d28

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/backend/regex/regcomp.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
2929
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
*
31-
* $PostgreSQL: pgsql/src/backend/regex/regcomp.c,v 1.41 2004/05/07 00:24:57 tgl Exp $
31+
* $PostgreSQL: pgsql/src/backend/regex/regcomp.c,v 1.42 2004/11/24 22:56:54 tgl Exp $
3232
*
3333
*/
3434

@@ -589,8 +589,13 @@ makesearch(struct vars * v,
589589
break;
590590
if (b != NULL)
591591
{ /* must be split */
592-
s->tmp = slist;
593-
slist = s;
592+
if (s->tmp == NULL)
593+
{ /* if not already in the list */
594+
/* (fixes bugs 505048, 230589, */
595+
/* 840258, 504785) */
596+
s->tmp = slist;
597+
slist = s;
598+
}
594599
}
595600
}
596601

@@ -2226,12 +2231,12 @@ stid(struct subre * t,
22262231
size_t bufsize)
22272232
{
22282233
/* big enough for hex int or decimal t->retry? */
2229-
if (bufsize < sizeof(int) * 2 + 3 || bufsize < sizeof(t->retry) * 3 + 1)
2234+
if (bufsize < sizeof(void *) * 2 + 3 || bufsize < sizeof(t->retry) * 3 + 1)
22302235
return "unable";
22312236
if (t->retry != 0)
22322237
sprintf(buf, "%d", t->retry);
22332238
else
2234-
sprintf(buf, "0x%x", (int) t); /* may lose bits, that's okay */
2239+
sprintf(buf, "%p", t);
22352240
return buf;
22362241
}
22372242
#endif /* REG_DEBUG */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy