pgsql: Sync our regex code with upstream changes since last time we did

Started by Tom Laneover 18 years ago4 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
Sync our regex code with upstream changes since last time we did this, which
was Tcl 8.4.8. The main changes are to remove the never-fully-implemented
code for multi-character collating elements, and to const-ify some stuff a
bit more fully. In combination with the recent security patch, this commit
brings us into line with Tcl 8.5.0.

Note that I didn't make any effort to duplicate a lot of cosmetic changes
that they made to bring their copy into line with their own style
guidelines, such as adding braces around single-line IF bodies. Most of
those we either had done already (such as ANSI-fication of function headers)
or there is no point because pgindent would undo the change anyway.

Modified Files:
--------------
pgsql/src/backend/regex:
regc_color.c (r1.8 -> r1.9)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/regex/regc_color.c?r1=1.8&r2=1.9)
regc_cvec.c (r1.5 -> r1.6)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/regex/regc_cvec.c?r1=1.5&r2=1.6)
regc_lex.c (r1.7 -> r1.8)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/regex/regc_lex.c?r1=1.7&r2=1.8)
regc_locale.c (r1.8 -> r1.9)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/regex/regc_locale.c?r1=1.8&r2=1.9)
regc_nfa.c (r1.5 -> r1.6)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/regex/regc_nfa.c?r1=1.5&r2=1.6)
regcomp.c (r1.45 -> r1.46)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/regex/regcomp.c?r1=1.45&r2=1.46)
regerror.c (r1.27 -> r1.28)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/regex/regerror.c?r1=1.27&r2=1.28)
pgsql/src/include/regex:
regcustom.h (r1.6 -> r1.7)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/regex/regcustom.h?r1=1.6&r2=1.7)
regguts.h (r1.6 -> r1.7)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/regex/regguts.h?r1=1.6&r2=1.7)

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#1)
Re: pgsql: Sync our regex code with upstream changes since last time we did

Tom Lane wrote:

Note that I didn't make any effort to duplicate a lot of cosmetic changes
that they made to bring their copy into line with their own style
guidelines, such as adding braces around single-line IF bodies. Most of
those we either had done already (such as ANSI-fication of function headers)
or there is no point because pgindent would undo the change anyway.

Not objecting, but IIRC we disabled the pgindent code that removes
braces around single line (or rather statement) IF bodies several years ago.

cheers

andrew

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Andrew Dunstan (#2)
Re: pgsql: Sync our regex code with upstream changes since last time we did

Andrew Dunstan wrote:

Tom Lane wrote:

Note that I didn't make any effort to duplicate a lot of cosmetic changes
that they made to bring their copy into line with their own style
guidelines, such as adding braces around single-line IF bodies. Most of
those we either had done already (such as ANSI-fication of function headers)
or there is no point because pgindent would undo the change anyway.

Not objecting, but IIRC we disabled the pgindent code that removes
braces around single line (or rather statement) IF bodies several years
ago.

Yeah, we did, because it was removing the braces around PG_TRY()
constructs.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#4Bruce Momjian
bruce@momjian.us
In reply to: Alvaro Herrera (#3)
Re: pgsql: Sync our regex code with upstream changes since last time we did

Alvaro Herrera wrote:

Andrew Dunstan wrote:

Tom Lane wrote:

Note that I didn't make any effort to duplicate a lot of cosmetic changes
that they made to bring their copy into line with their own style
guidelines, such as adding braces around single-line IF bodies. Most of
those we either had done already (such as ANSI-fication of function headers)
or there is no point because pgindent would undo the change anyway.

Not objecting, but IIRC we disabled the pgindent code that removes
braces around single line (or rather statement) IF bodies several years
ago.

Yeah, we did, because it was removing the braces around PG_TRY()
constructs.

We removed it because people didn't like changes to cases like:

if ()
{
a;
}
else
{
b;
}

I don't remember an issue with PG_TRY, which I could have fixed.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +