diff --git a/ChangeLog b/ChangeLog index 5d64b35..6bc766d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,13 +11,13 @@ with binary zeros. This is from Bugzilla #2681. Patch from Jeremie Courreges-Anglas via Nam Nguyen. This fixes RunGrepTest for OpenBSD. Later: it broke it for at least one version of Solaris, where tr can't handle binary zeros. However, that system had /usr/xpg4/bin/tr installed, which works OK, so -RunGrepTest now checks for that command and use it if found. +RunGrepTest now checks for that command and uses it if found. 2. Compiling with gcc 10.2's -fanalyzer option showed up a hypothetical problem with a NULL dereference. I don't think this case could ever occur in practice, but I have put in a check in order to get rid of the compiler error. -3. An alternative patch for CMakeLists.txt because 10.36 # 4 breaks CMake on +3. An alternative patch for CMakeLists.txt because 10.36 #4 breaks CMake on Windows. Patch from email@cs-ware.de fixes bugzilla #2688. 4. Two bugs related to over-large numbers have been fixed so the behaviour is @@ -44,6 +44,14 @@ recursions such as /(a\K.(?1)*)/ did not have this problem. 7. Restore single character repetition optimization in JIT. Currently fewer character repetitions are optimized than in 10.34. +8. When the names of the functions in the POSIX wrapper were changed to +pcre2_regcomp() etc. (see change 10.33 #4 below), functions with the original +names were left in the library so that pre-compiled programs would still work. +However, this has proved troublesome when programs link with several libraries, +some of which use PCRE2 via the POSIX interface while others use a native POSIX +library. For this reason, the POSIX function names are removed in this release. +The macros in pcre2posix.h should ensure that re-compiling fixes any programs +that haven't been compiled since before 10.33. Version 10.36 04-December-2020 diff --git a/doc/html/pcre2posix.html b/doc/html/pcre2posix.html index 20a2009..c54860f 100644 --- a/doc/html/pcre2posix.html +++ b/doc/html/pcre2posix.html @@ -68,11 +68,14 @@ application. Because the POSIX functions call the native ones, it is also necessary to add -lpcre2-8.
-Although they are not defined as protypes in pcre2posix.h, the library -does contain functions with the POSIX names regcomp() etc. These simply -pass their arguments to the PCRE2 functions. These functions are provided for -backwards compatibility with earlier versions of PCRE2, so that existing -programs do not have to be recompiled. +Although they were not defined as protypes in pcre2posix.h, releases +10.33 to 10.36 of the library contained functions with the POSIX names +regcomp() etc. These simply passed their arguments to the PCRE2 +functions. These functions were provided for backwards compatibility with +earlier versions of PCRE2, which had only POSIX names. However, this has proved +troublesome in situations where a program links with several libraries, some of +which use PCRE2's POSIX interface while others use the real POSIX functions. +For this reason, the POSIX names have been removed since release 10.37.
Calling the header file pcre2posix.h avoids any conflict with other POSIX @@ -344,9 +347,9 @@ Cambridge, England.
-Last updated: 30 January 2019
+Last updated: 26 April 2021
-Copyright © 1997-2019 University of Cambridge.
+Copyright © 1997-2021 University of Cambridge.
Return to the PCRE2 index page. diff --git a/doc/pcre2.txt b/doc/pcre2.txt index 365ecc4..61855f1 100644 --- a/doc/pcre2.txt +++ b/doc/pcre2.txt @@ -180,8 +180,8 @@ REVISION Last updated: 17 September 2018 Copyright (c) 1997-2018 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2API(3) Library Functions Manual PCRE2API(3) @@ -3829,8 +3829,8 @@ REVISION Last updated: 04 November 2020 Copyright (c) 1997-2020 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2BUILD(3) Library Functions Manual PCRE2BUILD(3) @@ -4423,8 +4423,8 @@ REVISION Last updated: 20 March 2020 Copyright (c) 1997-2020 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2CALLOUT(3) Library Functions Manual PCRE2CALLOUT(3) @@ -4853,8 +4853,8 @@ REVISION Last updated: 03 February 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2COMPAT(3) Library Functions Manual PCRE2COMPAT(3) @@ -5066,8 +5066,8 @@ REVISION Last updated: 06 October 2020 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2JIT(3) Library Functions Manual PCRE2JIT(3) @@ -5491,8 +5491,8 @@ REVISION Last updated: 23 May 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2LIMITS(3) Library Functions Manual PCRE2LIMITS(3) @@ -5561,8 +5561,8 @@ REVISION Last updated: 02 February 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2MATCHING(3) Library Functions Manual PCRE2MATCHING(3) @@ -5785,8 +5785,8 @@ REVISION Last updated: 23 May 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2PARTIAL(3) Library Functions Manual PCRE2PARTIAL(3) @@ -6165,8 +6165,8 @@ REVISION Last updated: 04 September 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2PATTERN(3) Library Functions Manual PCRE2PATTERN(3) @@ -9613,8 +9613,8 @@ REVISION Last updated: 06 October 2020 Copyright (c) 1997-2020 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2PERFORM(3) Library Functions Manual PCRE2PERFORM(3) @@ -9848,8 +9848,8 @@ REVISION Last updated: 03 February 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2POSIX(3) Library Functions Manual PCRE2POSIX(3) @@ -9895,11 +9895,15 @@ DESCRIPTION an application. Because the POSIX functions call the native ones, it is also necessary to add -lpcre2-8. - Although they are not defined as protypes in pcre2posix.h, the library - does contain functions with the POSIX names regcomp() etc. These simply - pass their arguments to the PCRE2 functions. These functions are pro- - vided for backwards compatibility with earlier versions of PCRE2, so - that existing programs do not have to be recompiled. + Although they were not defined as protypes in pcre2posix.h, releases + 10.33 to 10.36 of the library contained functions with the POSIX names + regcomp() etc. These simply passed their arguments to the PCRE2 func- + tions. These functions were provided for backwards compatibility with + earlier versions of PCRE2, which had only POSIX names. However, this + has proved troublesome in situations where a program links with several + libraries, some of which use PCRE2's POSIX interface while others use + the real POSIX functions. For this reason, the POSIX names have been + removed since release 10.37. Calling the header file pcre2posix.h avoids any conflict with other POSIX libraries. It can, of course, be renamed or aliased as regex.h, @@ -10175,11 +10179,11 @@ AUTHOR REVISION - Last updated: 30 January 2019 - Copyright (c) 1997-2019 University of Cambridge. + Last updated: 26 April 2021 + Copyright (c) 1997-2021 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2SAMPLE(3) Library Functions Manual PCRE2SAMPLE(3) @@ -10457,8 +10461,8 @@ REVISION Last updated: 27 June 2018 Copyright (c) 1997-2018 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2SYNTAX(3) Library Functions Manual PCRE2SYNTAX(3) @@ -10973,8 +10977,8 @@ REVISION Last updated: 28 December 2019 Copyright (c) 1997-2019 University of Cambridge. ------------------------------------------------------------------------------ - - + + PCRE2UNICODE(3) Library Functions Manual PCRE2UNICODE(3) @@ -11408,5 +11412,5 @@ REVISION Last updated: 23 February 2020 Copyright (c) 1997-2020 University of Cambridge. ------------------------------------------------------------------------------ - - + + diff --git a/doc/pcre2posix.3 b/doc/pcre2posix.3 index 35e68e2..a470c8f 100644 --- a/doc/pcre2posix.3 +++ b/doc/pcre2posix.3 @@ -1,4 +1,4 @@ -.TH PCRE2POSIX 3 "30 January 2019" "PCRE2 10.33" +.TH PCRE2POSIX 3 "26 April 2021" "PCRE2 10.37" .SH NAME PCRE2 - Perl-compatible regular expressions (revised API) .SH "SYNOPSIS" @@ -44,11 +44,14 @@ can be accessed by adding \fB-lpcre2-posix\fP to the command for linking an application. Because the POSIX functions call the native ones, it is also necessary to add \fB-lpcre2-8\fP. .P -Although they are not defined as protypes in \fBpcre2posix.h\fP, the library -does contain functions with the POSIX names \fBregcomp()\fP etc. These simply -pass their arguments to the PCRE2 functions. These functions are provided for -backwards compatibility with earlier versions of PCRE2, so that existing -programs do not have to be recompiled. +Although they were not defined as protypes in \fBpcre2posix.h\fP, releases +10.33 to 10.36 of the library contained functions with the POSIX names +\fBregcomp()\fP etc. These simply passed their arguments to the PCRE2 +functions. These functions were provided for backwards compatibility with +earlier versions of PCRE2, which had only POSIX names. However, this has proved +troublesome in situations where a program links with several libraries, some of +which use PCRE2's POSIX interface while others use the real POSIX functions. +For this reason, the POSIX names have been removed since release 10.37. .P Calling the header file \fBpcre2posix.h\fP avoids any conflict with other POSIX libraries. It can, of course, be renamed or aliased as \fBregex.h\fP, which is @@ -321,6 +324,6 @@ Cambridge, England. .rs .sp .nf -Last updated: 30 January 2019 -Copyright (c) 1997-2019 University of Cambridge. +Last updated: 26 April 2021 +Copyright (c) 1997-2021 University of Cambridge. .fi diff --git a/src/pcre2posix.c b/src/pcre2posix.c index b24620a..32c80c3 100644 --- a/src/pcre2posix.c +++ b/src/pcre2posix.c @@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Original API code Copyright (c) 1997-2012 University of Cambridge - New API code Copyright (c) 2016-2019 University of Cambridge + New API code Copyright (c) 2016-2021 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -175,6 +175,20 @@ static const char *const pstring[] = { +#if 0 /* REMOVE THIS CODE */ + +The code below was created for 10.33 (see ChangeLog 10.33 #4) when the +POSIX functions were given pcre2_... names instead of the traditional POSIX +names. However, it has proved to be more troublesome than useful. There have +been at least two cases where a program links with two others, one of which +uses the POSIX library and the other uses the PCRE2 POSIX functions, thus +causing two instances of the POSIX runctions to exist, leading to trouble. For +10.37 this code is commented out. In due course it can be removed if there are +no issues. The only small worry is the comment below about languages that do +not include pcre2posix.h. If there are any such cases, they will have to use +the PCRE2 names. + + /************************************************* * Wrappers with traditional POSIX names * *************************************************/ @@ -218,7 +232,7 @@ regexec(const regex_t *preg, const char *string, size_t nmatch, { return pcre2_regexec(preg, string, nmatch, pmatch, eflags); } - +#endif /*************************************************