[Pcre-svn] [1765] code/trunk: Fix a few small bugs and typos…

Kezdőlap
Üzenet törlése
Szerző: Subversion repository
Dátum:  
Címzett: pcre-svn
Tárgy: [Pcre-svn] [1765] code/trunk: Fix a few small bugs and typos and update docs for a final release.
Revision: 1765
          http://vcs.pcre.org/viewvc?view=rev&revision=1765
Author:   ph10
Date:     2021-06-14 12:21:20 +0100 (Mon, 14 Jun 2021)
Log Message:
-----------
Fix a few small bugs and typos and update docs for a final release.


Modified Paths:
--------------
    code/trunk/CMakeLists.txt
    code/trunk/ChangeLog
    code/trunk/NEWS
    code/trunk/NON-AUTOTOOLS-BUILD
    code/trunk/README
    code/trunk/configure.ac
    code/trunk/doc/html/NON-AUTOTOOLS-BUILD.txt
    code/trunk/doc/html/README.txt
    code/trunk/doc/html/index.html
    code/trunk/doc/html/pcre.html
    code/trunk/doc/pcre.3
    code/trunk/doc/pcre.txt
    code/trunk/doc/pcreapi.3
    code/trunk/doc/pcrejit.3
    code/trunk/doc/pcrepattern.3
    code/trunk/doc/pcresyntax.3
    code/trunk/pcre_compile.c
    code/trunk/pcre_exec.c
    code/trunk/pcredemo.c
    code/trunk/testdata/testinput1
    code/trunk/testdata/testoutput1


Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/CMakeLists.txt    2021-06-14 11:21:20 UTC (rev 1765)
@@ -67,17 +67,24 @@
 # 2013-11-05 PH added support for PARENS_NEST_LIMIT
 # 2016-03-01 PH applied Chris Wilson's patch for MSVC static build
 # 2016-06-24 PH applied Chris Wilson's revised patch (adds a separate option)
+# 2021-06-14 PH changed CMAKE_MODULE_PATH definition to add, not replace
+# 2021-06-14 PH applied Wolfgang Stöggl's patch for generating pcre-config and
+#            libpcre*.pc files (Bugzilla #2583)


PROJECT(PCRE C CXX)

-# Increased minimum to 2.8.0 to support newer add_test features. Set policy
+# Increased minimum to 2.8.5 to support GNUInstallDirs. Set policy
# CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY.

-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
CMAKE_POLICY(SET CMP0026 OLD)

-SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
+# For FindReadline.cmake. This was changed to allow setting CMAKE_MODULE_PATH
+# on the command line.
+# SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake

+LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
+
# external packages
FIND_PACKAGE( BZip2 )
FIND_PACKAGE( ZLIB )
@@ -90,6 +97,7 @@
INCLUDE(CheckIncludeFileCXX)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize)
+INCLUDE(GNUInstallDirs) # for CMAKE_INSTALL_LIBDIR

 CHECK_INCLUDE_FILE(dirent.h     HAVE_DIRENT_H)
 CHECK_INCLUDE_FILE(stdint.h     HAVE_STDINT_H)
@@ -406,7 +414,7 @@
     foreach(_substitution_variable ${SEARCHED_VARIABLES})
         string(TOUPPER ${_substitution_variable} _substitution_variable_upper)
         if (NOT ${_substitution_variable_upper})
-            string(REGEX MATCH "m4_define\\(${_substitution_variable}, \\[(.*)\\]" MACTHED_STRING ${configure_line})
+            string(REGEX MATCH "m4_define\\(${_substitution_variable}, \\[(.*)\\]" MATCHED_STRING ${configure_line})
             if (CMAKE_MATCH_1)
                 set(${_substitution_variable_upper} ${CMAKE_MATCH_1})
             endif()
@@ -418,8 +426,6 @@
                ${PROJECT_BINARY_DIR}/pcre.h
                @ONLY)


-# What about pcre-config and libpcre.pc?
-
 IF(PCRE_BUILD_PCRECPP)
         CONFIGURE_FILE(pcre_stringpiece.h.in
                        ${PROJECT_BINARY_DIR}/pcre_stringpiece.h
@@ -430,6 +436,49 @@
                        @ONLY)
 ENDIF(PCRE_BUILD_PCRECPP)


+# Generate pkg-config files
+SET(PACKAGE_VERSION "${PCRE_MAJOR}.${PCRE_MINOR}")
+SET(prefix "${CMAKE_INSTALL_PREFIX}")
+SET(exec_prefix "\${prefix}")
+SET(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
+SET(includedir "\${prefix}/include")
+IF(NOT BUILD_SHARED_LIBS)
+        SET(PCRE_STATIC_CFLAG "-DPCRE_STATIC")
+ENDIF(NOT BUILD_SHARED_LIBS)
+# TO-DO: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
+
+CONFIGURE_FILE(libpcreposix.pc.in ${PROJECT_BINARY_DIR}/libpcreposix.pc @ONLY)
+
+IF(PCRE_BUILD_PCRE8)
+  CONFIGURE_FILE(libpcre.pc.in ${PROJECT_BINARY_DIR}/libpcre.pc @ONLY)
+  SET(enable_pcre8 "yes")
+ELSE()
+  SET(enable_pcre8 "no")
+ENDIF()
+
+IF(PCRE_BUILD_PCRE16)
+  CONFIGURE_FILE(libpcre16.pc.in ${PROJECT_BINARY_DIR}/libpcre16.pc @ONLY)
+  SET(enable_pcre16 "yes")
+ELSE()
+  SET(enable_pcre16 "no")
+ENDIF()
+
+IF(PCRE_BUILD_PCRE32)
+  CONFIGURE_FILE(libpcre32.pc.in ${PROJECT_BINARY_DIR}/libpcre32.pc @ONLY)
+  SET(enable_pcre32 "yes")
+ELSE()
+  SET(enable_pcre32 "no")
+ENDIF()
+
+IF(PCRE_BUILD_PCRECPP)
+  CONFIGURE_FILE(libpcrecpp.pc.in ${PROJECT_BINARY_DIR}/libpcrecpp.pc @ONLY)
+  SET(enable_cpp "yes")
+ELSE()
+  SET(enable_cpp "no")
+ENDIF()
+
+CONFIGURE_FILE(pcre-config.in pcre-config @ONLY)
+
 # Character table generation


OPTION(PCRE_REBUILD_CHARTABLES "Rebuild char tables" OFF)
@@ -887,8 +936,8 @@

 INSTALL(TARGETS ${targets}
         RUNTIME DESTINATION bin
-        LIBRARY DESTINATION lib
-        ARCHIVE DESTINATION lib)
+        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})


INSTALL(FILES ${PCRE_HEADERS} ${PCREPOSIX_HEADERS} DESTINATION include)

@@ -895,6 +944,7 @@
FILE(GLOB html ${PROJECT_SOURCE_DIR}/doc/html/*.html)
FILE(GLOB man1 ${PROJECT_SOURCE_DIR}/doc/*.1)
FILE(GLOB man3 ${PROJECT_SOURCE_DIR}/doc/*.3)
+FILE(GLOB pc ${PROJECT_BINARY_DIR}/*.pc)

 IF(PCRE_BUILD_PCRECPP)
         INSTALL(FILES ${PCRECPP_HEADERS} DESTINATION include)
@@ -912,6 +962,11 @@
 INSTALL(FILES ${man1} DESTINATION man/man1)
 INSTALL(FILES ${man3} DESTINATION man/man3)
 INSTALL(FILES ${html} DESTINATION share/doc/pcre/html)
+INSTALL(FILES ${pc} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/pcre-config"
+        DESTINATION bin
+        # Set 0755 permissions
+        PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)


 IF(MSVC AND INSTALL_MSVC_PDB)
     INSTALL(FILES ${PROJECT_BINARY_DIR}/pcre.pdb
@@ -941,7 +996,7 @@
   ENDIF(CMAKE_CXX_FLAGS)
   MESSAGE(STATUS "")
   MESSAGE(STATUS "")
-  MESSAGE(STATUS "PCRE configuration summary:")
+  MESSAGE(STATUS "PCRE-${PCRE_MAJOR}.${PCRE_MINOR} configuration summary:")
   MESSAGE(STATUS "")
   MESSAGE(STATUS "  Install prefix .................. : ${CMAKE_INSTALL_PREFIX}")
   MESSAGE(STATUS "  C compiler ...................... : ${CMAKE_C_COMPILER}")


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/ChangeLog    2021-06-14 11:21:20 UTC (rev 1765)
@@ -1,10 +1,27 @@
 ChangeLog for PCRE
 ------------------


-Note that the PCRE 8.xx series (PCRE1) is now in a bugfix-only state. All
-development is happening in the PCRE2 10.xx series.
+Note that the PCRE 8.xx series (PCRE1) is now at end of life. All development
+is happening in the PCRE2 10.xx series.


+Version 8.45 14-June-2021
+-------------------------
+
+This is the final release of PCRE1. A few minor tidies are included.
+
+1. CMakeLists.txt has two user-supplied patches applied, one to allow for the
+setting of MODULE_PATH, and the other to support the generation of pcre-config
+file and libpcre*.pc files.
+
+2. There was a memory leak if a compile error occurred when there were more
+than 20 named groups (Bugzilla #2613).
+
+3. Fixed some typos in code and documentation.
+
+4. Fixed a small (*MARK) bug in the interpreter (Bugzilla #2771).
+
+
Version 8.44 12 February-2020
-----------------------------


Modified: code/trunk/NEWS
===================================================================
--- code/trunk/NEWS    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/NEWS    2021-06-14 11:21:20 UTC (rev 1765)
@@ -1,10 +1,16 @@
 News about PCRE releases
 ------------------------


-Note that this library (now called PCRE1) is now being maintained for bug fixes
-only. New projects are advised to use the new PCRE2 libraries.
+Note that this library (now called PCRE1) is no longer being maintained. New
+projects are advised to use the PCRE2 libraries.


+Release 8.45 14-June-2021
+-----------------------------
+
+This is the final PCRE1 release.
+
+
Release 8.44 12-February-2020
-----------------------------


Modified: code/trunk/NON-AUTOTOOLS-BUILD
===================================================================
--- code/trunk/NON-AUTOTOOLS-BUILD    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/NON-AUTOTOOLS-BUILD    2021-06-14 11:21:20 UTC (rev 1765)
@@ -5,8 +5,8 @@
 library names libpcre, libpcre16, and libpcre32. January 2015 saw the first
 release of a new API, known as PCRE2, with release numbers starting at 10.00
 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old libraries
-(now called PCRE1) are still being maintained for bug fixes, but there will be
-no new development. New projects are advised to use the new PCRE2 libraries.
+(now called PCRE1) are now at end of life, and 8.45 is the final release. New
+projects are advised to use the new PCRE2 libraries.



This document contains the following sections:

Modified: code/trunk/README
===================================================================
--- code/trunk/README    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/README    2021-06-14 11:21:20 UTC (rev 1765)
@@ -5,9 +5,8 @@
 with library names libpcre, libpcre16, and libpcre32. January 2015 saw the
 first release of a new API, known as PCRE2, with release numbers starting at
 10.00 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old
-libraries (now called PCRE1) are still being maintained for bug fixes, but
-there will be no new development. New projects are advised to use the new PCRE2
-libraries.
+libraries (now called PCRE1) are now at end of life, and 8.45 is the final
+release. New projects are advised to use the new PCRE2 libraries.



The latest release of PCRE1 is always available in three alternative formats

Modified: code/trunk/configure.ac
===================================================================
--- code/trunk/configure.ac    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/configure.ac    2021-06-14 11:21:20 UTC (rev 1765)
@@ -9,9 +9,9 @@
 dnl be defined as -RC2, for example. For real releases, it should be empty.


m4_define(pcre_major, [8])
-m4_define(pcre_minor, [44])
+m4_define(pcre_minor, [45])
m4_define(pcre_prerelease, [])
-m4_define(pcre_date, [2020-02-12])
+m4_define(pcre_date, [2021-06-14])

# NOTE: The CMakeLists.txt file searches for the above variables in the first
# 50 lines of this file. Please update that if the variables above are moved.

Modified: code/trunk/doc/html/NON-AUTOTOOLS-BUILD.txt
===================================================================
--- code/trunk/doc/html/NON-AUTOTOOLS-BUILD.txt    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/html/NON-AUTOTOOLS-BUILD.txt    2021-06-14 11:21:20 UTC (rev 1765)
@@ -5,8 +5,8 @@
 library names libpcre, libpcre16, and libpcre32. January 2015 saw the first
 release of a new API, known as PCRE2, with release numbers starting at 10.00
 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old libraries
-(now called PCRE1) are still being maintained for bug fixes, but there will be
-no new development. New projects are advised to use the new PCRE2 libraries.
+(now called PCRE1) are now at end of life, and 8.45 is the final release. New
+projects are advised to use the new PCRE2 libraries.



This document contains the following sections:

Modified: code/trunk/doc/html/README.txt
===================================================================
--- code/trunk/doc/html/README.txt    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/html/README.txt    2021-06-14 11:21:20 UTC (rev 1765)
@@ -5,9 +5,8 @@
 with library names libpcre, libpcre16, and libpcre32. January 2015 saw the
 first release of a new API, known as PCRE2, with release numbers starting at
 10.00 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old
-libraries (now called PCRE1) are still being maintained for bug fixes, but
-there will be no new development. New projects are advised to use the new PCRE2
-libraries.
+libraries (now called PCRE1) are now at end of life, and 8.45 is the final
+release. New projects are advised to use the new PCRE2 libraries.



The latest release of PCRE1 is always available in three alternative formats

Modified: code/trunk/doc/html/index.html
===================================================================
--- code/trunk/doc/html/index.html    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/html/index.html    2021-06-14 11:21:20 UTC (rev 1765)
@@ -1,10 +1,10 @@
 <html>
-<!-- This is a manually maintained file that is the root of the HTML version of
-     the PCRE documentation. When the HTML documents are built from the man
-     page versions, the entire doc/html directory is emptied, this file is then
-     copied into doc/html/index.html, and the remaining files therein are
+<!-- This is a manually maintained file that is the root of the HTML version of 
+     the PCRE documentation. When the HTML documents are built from the man 
+     page versions, the entire doc/html directory is emptied, this file is then 
+     copied into doc/html/index.html, and the remaining files therein are 
      created by the 132html script.
--->
+-->      
 <head>
 <title>PCRE specification</title>
 </head>
@@ -96,7 +96,7 @@
 functions.
 </p>


-<table>
+<table>    


 <tr><td><a href="pcre_assign_jit_stack.html">pcre_assign_jit_stack</a></td>
     <td>&nbsp;&nbsp;Assign stack for JIT matching</td></tr>
@@ -162,7 +162,7 @@


 <tr><td><a href="pcre_maketables.html">pcre_maketables</a></td>
     <td>&nbsp;&nbsp;Build character tables in current locale</td></tr>
-
+    
 <tr><td><a href="pcre_pattern_to_host_byte_order.html">pcre_pattern_to_host_byte_order</a></td>
     <td>&nbsp;&nbsp;Convert compiled pattern to host byte order if necessary</td></tr>



Modified: code/trunk/doc/html/pcre.html
===================================================================
--- code/trunk/doc/html/pcre.html    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/html/pcre.html    2021-06-14 11:21:20 UTC (rev 1765)
@@ -22,13 +22,12 @@
 </ul>
 <br><a name="SEC1" href="#TOC1">PLEASE TAKE NOTE</a><br>
 <P>
-This document relates to PCRE releases that use the original API,
-with library names libpcre, libpcre16, and libpcre32. January 2015 saw the
-first release of a new API, known as PCRE2, with release numbers starting at
-10.00 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old
-libraries (now called PCRE1) are still being maintained for bug fixes, but
-there will be no new development. New projects are advised to use the new PCRE2
-libraries.
+This document relates to PCRE releases that use the original API, with library
+names libpcre, libpcre16, and libpcre32. January 2015 saw the first release of
+a new API, known as PCRE2, with release numbers starting at 10.00 and library
+names libpcre2-8, libpcre2-16, and libpcre2-32. The old libraries (now called
+PCRE1) are now at end of life, and 8.45 is the final release. New projects are
+advised to use the new PCRE2 libraries.
 </P>
 <br><a name="SEC2" href="#TOC1">INTRODUCTION</a><br>
 <P>
@@ -215,9 +214,9 @@
 </P>
 <br><a name="SEC6" href="#TOC1">REVISION</a><br>
 <P>
-Last updated: 10 February 2015
+Last updated: 14 June 2021
 <br>
-Copyright &copy; 1997-2015 University of Cambridge.
+Copyright &copy; 1997-2021 University of Cambridge.
 <br>
 <p>
 Return to the <a href="index.html">PCRE index page</a>.


Modified: code/trunk/doc/pcre.3
===================================================================
--- code/trunk/doc/pcre.3    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/pcre.3    2021-06-14 11:21:20 UTC (rev 1765)
@@ -1,16 +1,15 @@
-.TH PCRE 3 "10 February 2015" "PCRE 8.37"
+.TH PCRE 3 "14 June 2021" "PCRE 8.45"
 .SH NAME
 PCRE - Perl-compatible regular expressions (original API)
 .SH "PLEASE TAKE NOTE"
 .rs
 .sp
-This document relates to PCRE releases that use the original API,
-with library names libpcre, libpcre16, and libpcre32. January 2015 saw the
-first release of a new API, known as PCRE2, with release numbers starting at
-10.00 and library names libpcre2-8, libpcre2-16, and libpcre2-32. The old
-libraries (now called PCRE1) are still being maintained for bug fixes, but
-there will be no new development. New projects are advised to use the new PCRE2
-libraries.
+This document relates to PCRE releases that use the original API, with library
+names libpcre, libpcre16, and libpcre32. January 2015 saw the first release of
+a new API, known as PCRE2, with release numbers starting at 10.00 and library
+names libpcre2-8, libpcre2-16, and libpcre2-32. The old libraries (now called
+PCRE1) are now at end of life, and 8.45 is the final release. New projects are
+advised to use the new PCRE2 libraries.
 .
 .
 .SH INTRODUCTION
@@ -225,6 +224,6 @@
 .rs
 .sp
 .nf
-Last updated: 10 February 2015
-Copyright (c) 1997-2015 University of Cambridge.
+Last updated: 14 June 2021
+Copyright (c) 1997-2021 University of Cambridge.
 .fi


Modified: code/trunk/doc/pcre.txt
===================================================================
--- code/trunk/doc/pcre.txt    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/pcre.txt    2021-06-14 11:21:20 UTC (rev 1765)
@@ -21,9 +21,9 @@
        library names libpcre, libpcre16, and libpcre32. January 2015  saw  the
        first release of a new API, known as PCRE2, with release numbers start-
        ing  at  10.00  and  library   names   libpcre2-8,   libpcre2-16,   and
-       libpcre2-32. The old libraries (now called PCRE1) are still being main-
-       tained for bug fixes,  but  there  will  be  no  new  development.  New
-       projects are advised to use the new PCRE2 libraries.
+       libpcre2-32.  The  old  libraries  (now called PCRE1) are now at end of
+       life, and 8.45 is the final release. New projects are  advised  to  use
+       the new PCRE2 libraries.



INTRODUCTION
@@ -190,11 +190,11 @@

REVISION

-       Last updated: 10 February 2015
-       Copyright (c) 1997-2015 University of Cambridge.
+       Last updated: 14 June 2021
+       Copyright (c) 1997-2021 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCRE(3)                    Library Functions Manual                    PCRE(3)



@@ -525,8 +525,8 @@
        Last updated: 12 May 2013
        Copyright (c) 1997-2013 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCRE(3)                    Library Functions Manual                    PCRE(3)



@@ -853,8 +853,8 @@
        Last updated: 12 May 2013
        Copyright (c) 1997-2013 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREBUILD(3)               Library Functions Manual               PCREBUILD(3)



@@ -1356,8 +1356,8 @@
        Last updated: 12 May 2013
        Copyright (c) 1997-2013 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREMATCHING(3)            Library Functions Manual            PCREMATCHING(3)



@@ -1574,8 +1574,8 @@
        Last updated: 12 November 2013
        Copyright (c) 1997-2012 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREAPI(3)                 Library Functions Manual                 PCREAPI(3)



@@ -4275,8 +4275,8 @@
        Last updated: 18 December 2015
        Copyright (c) 1997-2015 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCRECALLOUT(3)             Library Functions Manual             PCRECALLOUT(3)



@@ -4525,8 +4525,8 @@
        Last updated: 12 November 2013
        Copyright (c) 1997-2013 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCRECOMPAT(3)              Library Functions Manual              PCRECOMPAT(3)



@@ -4720,8 +4720,8 @@
        Last updated: 10 November 2013
        Copyright (c) 1997-2013 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREPATTERN(3)             Library Functions Manual             PCREPATTERN(3)



@@ -7670,8 +7670,8 @@
        Last updated: 23 October 2016
        Copyright (c) 1997-2016 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCRESYNTAX(3)              Library Functions Manual              PCRESYNTAX(3)



@@ -8076,8 +8076,8 @@
        Last updated: 08 January 2014
        Copyright (c) 1997-2014 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREUNICODE(3)             Library Functions Manual             PCREUNICODE(3)



@@ -8295,8 +8295,8 @@
        Last updated: 27 February 2013
        Copyright (c) 1997-2013 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREJIT(3)                 Library Functions Manual                 PCREJIT(3)



@@ -8750,8 +8750,8 @@
        Last updated: 05 July 2017
        Copyright (c) 1997-2017 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREPARTIAL(3)             Library Functions Manual             PCREPARTIAL(3)



@@ -9235,8 +9235,8 @@
        Last updated: 02 July 2013
        Copyright (c) 1997-2013 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREPRECOMPILE(3)          Library Functions Manual          PCREPRECOMPILE(3)



@@ -9374,8 +9374,8 @@
        Last updated: 12 November 2013
        Copyright (c) 1997-2013 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREPERFORM(3)             Library Functions Manual             PCREPERFORM(3)



@@ -9544,8 +9544,8 @@
        Last updated: 25 August 2012
        Copyright (c) 1997-2012 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCREPOSIX(3)               Library Functions Manual               PCREPOSIX(3)



@@ -9808,8 +9808,8 @@
        Last updated: 09 January 2012
        Copyright (c) 1997-2012 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCRECPP(3)                 Library Functions Manual                 PCRECPP(3)



@@ -10151,8 +10151,8 @@

        Last updated: 08 January 2012
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCRESAMPLE(3)              Library Functions Manual              PCRESAMPLE(3)



@@ -10305,8 +10305,8 @@
        Last updated: 05 November 2013
        Copyright (c) 1997-2013 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 
 PCRESTACK(3)               Library Functions Manual               PCRESTACK(3)



@@ -10491,5 +10491,5 @@
        Last updated: 24 June 2012
        Copyright (c) 1997-2012 University of Cambridge.
 ------------------------------------------------------------------------------
-
-
+ 
+ 


Modified: code/trunk/doc/pcreapi.3
===================================================================
--- code/trunk/doc/pcreapi.3    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/pcreapi.3    2021-06-14 11:21:20 UTC (rev 1765)
@@ -1699,7 +1699,7 @@
 .P
 The default value for the limit can be set when PCRE is built; the default
 default is 10 million, which handles all but the most extreme cases. You can
-override the default by suppling \fBpcre_exec()\fP with a \fBpcre_extra\fP
+override the default by supplying \fBpcre_exec()\fP with a \fBpcre_extra\fP
 block in which \fImatch_limit\fP is set, and PCRE_EXTRA_MATCH_LIMIT is set in
 the \fIflags\fP field. If the limit is exceeded, \fBpcre_exec()\fP returns
 PCRE_ERROR_MATCHLIMIT.
@@ -1726,7 +1726,7 @@
 .P
 The default value for \fImatch_limit_recursion\fP can be set when PCRE is
 built; the default default is the same value as the default for
-\fImatch_limit\fP. You can override the default by suppling \fBpcre_exec()\fP
+\fImatch_limit\fP. You can override the default by supplying \fBpcre_exec()\fP
 with a \fBpcre_extra\fP block in which \fImatch_limit_recursion\fP is set, and
 PCRE_EXTRA_MATCH_LIMIT_RECURSION is set in the \fIflags\fP field. If the limit
 is exceeded, \fBpcre_exec()\fP returns PCRE_ERROR_RECURSIONLIMIT.
@@ -2044,10 +2044,10 @@
 .sp
 which finds occurrences of "iss" in the middle of words. (\eB matches only if
 the current position in the subject is not a word boundary.) When applied to
-the string "Mississipi" the first call to \fBpcre_exec()\fP finds the first
+the string "Mississippi" the first call to \fBpcre_exec()\fP finds the first
 occurrence. If \fBpcre_exec()\fP is called again with just the remainder of the
-subject, namely "issipi", it does not match, because \eB is always false at the
-start of the subject, which is deemed to be a word boundary. However, if
+subject, namely "issippi", it does not match, because \eB is always false at
+the start of the subject, which is deemed to be a word boundary. However, if
 \fBpcre_exec()\fP is passed the entire string again, but with \fIstartoffset\fP
 set to 4, it finds the second occurrence of "iss" because it is able to look
 behind the starting point to discover that it is preceded by a letter.


Modified: code/trunk/doc/pcrejit.3
===================================================================
--- code/trunk/doc/pcrejit.3    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/pcrejit.3    2021-06-14 11:21:20 UTC (rev 1765)
@@ -285,7 +285,7 @@
 This is a suggestion for how a multithreaded program that needs to set up
 non-default JIT stacks might operate:
 .sp
-  During thread initalization
+  During thread initialization
     thread_local_var = pcre_jit_stack_alloc(...)
 .sp
   During thread exit


Modified: code/trunk/doc/pcrepattern.3
===================================================================
--- code/trunk/doc/pcrepattern.3    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/pcrepattern.3    2021-06-14 11:21:20 UTC (rev 1765)
@@ -656,7 +656,7 @@
 .P
 It is possible to restrict \eR to match only CR, LF, or CRLF (instead of the
 complete set of Unicode line endings) by setting the option PCRE_BSR_ANYCRLF
-either at compile time or when the pattern is matched. (BSR is an abbrevation
+either at compile time or when the pattern is matched. (BSR is an abbreviation
 for "backslash R".) This can be made the default when PCRE is built; if this is
 the case, the other behaviour can be requested via the PCRE_BSR_UNICODE option.
 It is also possible to specify these settings by starting a pattern string with
@@ -968,7 +968,7 @@
 3. Do not break Hangul (a Korean script) syllable sequences. Hangul characters
 are of five types: L, V, T, LV, and LVT. An L character may be followed by an
 L, V, LV, or LVT character; an LV or V character may be followed by a V or T
-character; an LVT or T character may be follwed only by a T character.
+character; an LVT or T character may be followed only by a T character.
 .P
 4. Do not end before extending characters or spacing marks. Characters with
 the "mark" property always have the "extend" grapheme breaking property.
@@ -3115,7 +3115,7 @@
 .sp
 If the subject is "aaaac...", after the first match attempt fails (starting at
 the first character in the string), the starting point skips on to start the
-next attempt at "c". Note that a possessive quantifer does not have the same
+next attempt at "c". Note that a possessive quantifier does not have the same
 effect as this example; although it would suppress backtracking during the
 first match attempt, the second attempt would start at the second character
 instead of skipping on to "c".


Modified: code/trunk/doc/pcresyntax.3
===================================================================
--- code/trunk/doc/pcresyntax.3    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/doc/pcresyntax.3    2021-06-14 11:21:20 UTC (rev 1765)
@@ -123,7 +123,7 @@
   Xan        Alphanumeric: union of properties L and N
   Xps        POSIX space: property Z or tab, NL, VT, FF, CR
   Xsp        Perl space: property Z or tab, NL, VT, FF, CR
-  Xuc        Univerally-named character: one that can be
+  Xuc        Universally-named character: one that can be
                represented by a Universal Character Name
   Xwd        Perl word: property Xan or underscore
 .sp


Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/pcre_compile.c    2021-06-14 11:21:20 UTC (rev 1765)
@@ -6,7 +6,7 @@
 and semantics are as close as possible to those of the Perl 5 language.


                        Written by Philip Hazel
-           Copyright (c) 1997-2020 University of Cambridge
+           Copyright (c) 1997-2021 University of Cambridge


-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -9099,6 +9099,8 @@
similar way to cworkspace, it can be expanded using malloc() if necessary. */

named_group named_groups[NAMED_GROUP_LIST_SIZE];
+cd->named_groups = named_groups;
+cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;

/* Set this early so that early errors get offset 0. */

@@ -9372,8 +9374,6 @@
 cd->iscondassert = FALSE;
 cd->start_workspace = cworkspace;
 cd->workspace_size = COMPILE_WORK_SIZE;
-cd->named_groups = named_groups;
-cd->named_group_list_size = NAMED_GROUP_LIST_SIZE;
 cd->start_pattern = (const pcre_uchar *)pattern;
 cd->end_pattern = (const pcre_uchar *)(pattern + STRLEN_UC((const pcre_uchar *)pattern));
 cd->req_varyopt = 0;
@@ -9484,6 +9484,7 @@
     add_name(cd, ng->name, ng->length, ng->number);
   if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
     (PUBL(free))((void *)cd->named_groups);
+  cd->named_group_list_size = 0;   /* So we don't free it twice */   
   }


 /* Set up a starting, non-extracting bracket, then compile the expression. On
@@ -9634,6 +9635,8 @@
   {
   (PUBL(free))(re);
   PCRE_EARLY_ERROR_RETURN:
+  if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE)
+    (PUBL(free))((void *)cd->named_groups);
   *erroroffset = (int)(ptr - (const pcre_uchar *)pattern);
   PCRE_EARLY_ERROR_RETURN2:
   *errorptr = find_error_text(errorcode);


Modified: code/trunk/pcre_exec.c
===================================================================
--- code/trunk/pcre_exec.c    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/pcre_exec.c    2021-06-14 11:21:20 UTC (rev 1765)
@@ -6,7 +6,7 @@
 and semantics are as close as possible to those of the Perl 5 language.


                        Written by Philip Hazel
-           Copyright (c) 1997-2018 University of Cambridge
+           Copyright (c) 1997-2021 University of Cambridge


 -----------------------------------------------------------------------------
 Redistribution and use in source and binary forms, with or without
@@ -758,7 +758,7 @@
     md->mark = NULL;    /* In case previously set by assertion */
     RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
       eptrb, RM55);
-    if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) &&
+    if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT || rrc == MATCH_KETRPOS) &&
          md->mark == NULL) md->mark = ecode + 2;


     /* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an


Modified: code/trunk/pcredemo.c
===================================================================
--- code/trunk/pcredemo.c    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/pcredemo.c    2021-06-14 11:21:20 UTC (rev 1765)
@@ -144,7 +144,7 @@
   return 1;
   }


-/* Match succeded */
+/* Match succeeded */

printf("\nMatch succeeded at offset %d\n", ovector[0]);

@@ -362,7 +362,7 @@
     return 1;
     }


- /* Match succeded */
+ /* Match succeeded */

printf("\nMatch succeeded again at offset %d\n", ovector[0]);


Modified: code/trunk/testdata/testinput1
===================================================================
--- code/trunk/testdata/testinput1    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/testdata/testinput1    2021-06-14 11:21:20 UTC (rev 1765)
@@ -5757,4 +5757,7 @@
 /(?&word)*  \. (?<word> \w+ )/xi
     pokus.hokus


+/(?:A(*:X))*+/K
+    A
+
 /-- End of testinput1 --/


Modified: code/trunk/testdata/testoutput1
===================================================================
--- code/trunk/testdata/testoutput1    2020-02-12 17:41:25 UTC (rev 1764)
+++ code/trunk/testdata/testoutput1    2021-06-14 11:21:20 UTC (rev 1765)
@@ -9470,4 +9470,9 @@
  0: pokus.hokus
  1: hokus


+/(?:A(*:X))*+/K
+    A
+ 0: A
+MK: X
+
 /-- End of testinput1 --/