mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Sync regex code with Tcl 8.6.4.
Sync our regex code with upstream changes since last time we did this,
which was Tcl 8.5.11 (see commit 08fd6ff37f
).
The only functional change here is to disbelieve that an octal escape is
three digits long if it would exceed \377. That's a bug fix, but it's
a minor one and could change the interpretation of working regexes, so
don't back-patch.
In addition to that, s/INFINITY/DUPINF/ to eliminate the risk of collisions
with <math.h>'s macro, and s/LOCAL/NOPROP/ because that also seems like
an unnecessarily collision-prone macro name.
There were some other cosmetic changes in their copy that I did not adopt,
notably a rather half-hearted attempt at renaming some of the C functions
in a more verbose style. (I'm not necessarily against the concept, but
renaming just a few functions in the package is not an improvement.)
This commit is contained in:
@ -860,6 +860,12 @@ lexescape(struct vars * v)
|
||||
c = lexdigits(v, 8, 1, 3);
|
||||
if (ISERR())
|
||||
FAILW(REG_EESCAPE);
|
||||
if (c > 0xff)
|
||||
{
|
||||
/* out of range, so we handled one digit too much */
|
||||
v->now--;
|
||||
c >>= 3;
|
||||
}
|
||||
RETV(PLAIN, c);
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user