Index: ossp-pkg/pcre/.configure RCS File: /v/ossp/cvs/ossp-pkg/pcre/.configure,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/pcre/.configure,v' 2>/dev/null --- .configure 2000/08/02 08:52:21 1.2 +++ .configure 2000/08/29 19:24:17 1.3 @@ -1,5 +1,5 @@ #!/bin/sh -CC="egcc" \ +CC="cc" \ CFLAGS="-pipe -O2 -Wall -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline" \ ./configure \ --prefix=/sw/pkg/pcre \ Index: ossp-pkg/pcre/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/pcre/ChangeLog,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/pcre/ChangeLog,v' 2>/dev/null --- ChangeLog 2000/08/02 09:46:06 1.6 +++ ChangeLog 2000/08/29 19:24:17 1.7 @@ -2,6 +2,14 @@ ------------------ +Version 3.4 22-Aug-00 +--------------------- + +1. Fixed typo in pcre.h: unsigned const char * changed to const unsigned char *. + +2. Diagnose condition (?(0) as an error instead of crashing on matching. + + Version 3.3 01-Aug-00 --------------------- Index: ossp-pkg/pcre/ChangeLog.OSSP RCS File: /v/ossp/cvs/ossp-pkg/pcre/ChangeLog.OSSP,v rcsdiff -q -kk '-r1.14' '-r1.15' -u '/v/ossp/cvs/ossp-pkg/pcre/ChangeLog.OSSP,v' 2>/dev/null --- ChangeLog.OSSP 2000/08/02 09:46:06 1.14 +++ ChangeLog.OSSP 2000/08/29 19:24:17 1.15 @@ -2,6 +2,10 @@ OSSP ChangeLog for PCRE ======================= + Changes made to OSSP pcre 3.4-1 (01-Aug-2000 to 29-Aug-2000): + + *) Merged in changes between PCRE 3.3 to 3.4 + Changes made to OSSP pcre 3.3-1 (07-Jul-2000 to 01-Aug-2000): *) Merged in changes between PCRE 3.2 to 3.3 Index: ossp-pkg/pcre/configure RCS File: /v/ossp/cvs/ossp-pkg/pcre/Attic/configure,v rcsdiff -q -kk '-r1.9' '-r1.10' -u '/v/ossp/cvs/ossp-pkg/pcre/Attic/configure,v' 2>/dev/null --- configure 2000/08/02 09:46:06 1.9 +++ configure 2000/08/29 19:24:17 1.10 @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.5 +# From configure.in Revision: 1.6 SHTOOL="./shtool" Index: ossp-pkg/pcre/pcre.3 RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre.3,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre.3,v' 2>/dev/null --- pcre.3 2000/08/02 09:46:06 1.4 +++ pcre.3 2000/08/29 19:24:17 1.5 @@ -1245,7 +1245,7 @@ /* first command */ not comment /* second comment */ -fails, because it matches the entire string due to the greediness of the .* +fails, because it matches the entire string owing to the greediness of the .* item. However, if a quantifier is followed by a question mark, it ceases to be @@ -1564,9 +1564,10 @@ There are two kinds of condition. If the text between the parentheses consists of a sequence of digits, the condition is satisfied if the capturing subpattern -of that number has previously matched. Consider the following pattern, which -contains non-significant white space to make it more readable (assume the -PCRE_EXTENDED option) and to divide it into three parts for ease of discussion: +of that number has previously matched. The number must be greater than zero. +Consider the following pattern, which contains non-significant white space to +make it more readable (assume the PCRE_EXTENDED option) and to divide it into +three parts for ease of discussion: ( \\( )? [^()]+ (?(1) \\) ) Index: ossp-pkg/pcre/pcre.c RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre.c,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre.c,v' 2>/dev/null --- pcre.c 2000/08/02 09:53:08 1.6 +++ pcre.c 2000/08/29 19:24:17 1.7 @@ -224,11 +224,11 @@ len = 1; \ if (md->utf8 && (c & 0xc0) == 0xc0) \ { \ - int i; \ + int _i; \ int a = utf8_table4[c & 0x3f]; /* Number of additional bytes */ \ int s = 6 - a; /* Amount to shift next byte */ \ c &= utf8_table3[a]; /* Low order bits from first byte */ \ - for (i = 1; i <= a; i++) \ + for (_i = 1; _i <= a; _i++) \ { \ c |= (eptr[i] & 0x3f) << s; \ s += 6; \ @@ -1753,6 +1753,11 @@ { condref = *ptr - '0'; while (*(++ptr) != ')') condref = condref*10 + *ptr - '0'; + if (condref == 0) + { + *errorptr = ERR35; + goto FAILED; + } ptr++; } else ptr--; @@ -2094,7 +2099,7 @@ ptrptr -> the address of the current pattern pointer errorptr -> pointer to error message lookbehind TRUE if this is a lookbehind assertion - condref > 0 for OPT_CREF setting at start of conditional group + condref >= 0 for OPT_CREF setting at start of conditional group reqchar -> place to put the last required character, or a negative number countlits -> place to put the shortest literal count of any branch cd points to the data block with tables pointers @@ -2122,7 +2127,7 @@ /* At the start of a reference-based conditional group, insert the reference number as an OP_CREF item. */ -if (condref > 0) +if (condref >= 0) { *code++ = OP_CREF; *code++ = condref; Index: ossp-pkg/pcre/pcre.h RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre.h,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre.h,v' 2>/dev/null --- pcre.h 2000/08/02 09:46:06 1.6 +++ pcre.h 2000/08/29 19:24:17 1.7 @@ -8,8 +8,8 @@ #define _PCRE_H #define PCRE_MAJOR 3 -#define PCRE_MINOR 3 -#define PCRE_DATE 01-Aug-2000 +#define PCRE_MINOR 4 +#define PCRE_DATE 22-Aug-2000 #define __PCRE_STRING(a) #a #define __PCRE_XSTRING(s) _STRING(s) Index: ossp-pkg/pcre/pcre_internal.h RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre_internal.h,v rcsdiff -q -kk '-r1.5' '-r1.6' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre_internal.h,v' 2>/dev/null --- pcre_internal.h 2000/08/02 09:46:06 1.5 +++ pcre_internal.h 2000/08/29 19:24:17 1.6 @@ -277,6 +277,7 @@ #define ERR32 "this version of PCRE is not compiled with PCRE_UTF8 support" #define ERR33 "characters with values > 255 are not yet supported in classes" #define ERR34 "character value in \\x{...} sequence is too large" +#define ERR35 "invalid condition (?(0)" /* All character handling must be done as unsigned characters. Otherwise there are problems with top-bit-set characters and functions such as isspace(). Index: ossp-pkg/pcre/pcre_test.d/testinput2 RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testinput2,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testinput2,v' 2>/dev/null --- testinput2 2000/08/02 09:46:09 1.4 +++ testinput2 2000/08/29 19:24:19 1.5 @@ -707,4 +707,6 @@ /[\200-\410]/ +/^(?(0)f|b)oo/ + / End of testinput2 / Index: ossp-pkg/pcre/pcre_test.d/testoutput1 RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput1,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput1,v' 2>/dev/null --- testoutput1 2000/08/02 09:46:09 1.6 +++ testoutput1 2000/08/29 19:24:19 1.7 @@ -1,4 +1,4 @@ -PCRE version 3.3 01-Aug-2000 +PCRE version 3.4 22-Aug-2000 /the quick brown fox/ the quick brown fox Index: ossp-pkg/pcre/pcre_test.d/testoutput2 RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput2,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput2,v' 2>/dev/null --- testoutput2 2000/08/02 09:46:09 1.6 +++ testoutput2 2000/08/29 19:24:19 1.7 @@ -1,4 +1,4 @@ -PCRE version 3.3 01-Aug-2000 +PCRE version 3.4 22-Aug-2000 /(a)b|/ Capturing subpattern count = 1 @@ -2064,6 +2064,9 @@ /[\200-\410]/ Failed: range out of order in character class at offset 9 +/^(?(0)f|b)oo/ +Failed: invalid condition (?(0) at offset 5 + / End of testinput2 / Capturing subpattern count = 0 No options Index: ossp-pkg/pcre/pcre_test.d/testoutput3 RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput3,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput3,v' 2>/dev/null --- testoutput3 2000/08/02 09:46:09 1.6 +++ testoutput3 2000/08/29 19:24:19 1.7 @@ -1,4 +1,4 @@ -PCRE version 3.3 01-Aug-2000 +PCRE version 3.4 22-Aug-2000 /(?/dev/null --- testoutput4 2000/08/02 09:46:09 1.6 +++ testoutput4 2000/08/29 19:24:19 1.7 @@ -1,4 +1,4 @@ -PCRE version 3.3 01-Aug-2000 +PCRE version 3.4 22-Aug-2000 /^[\w]+/ *** Failers Index: ossp-pkg/pcre/pcre_test.d/testoutput5 RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput5,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput5,v' 2>/dev/null --- testoutput5 2000/08/02 09:46:09 1.1 +++ testoutput5 2000/08/29 19:24:19 1.2 @@ -1,4 +1,4 @@ -PCRE version 3.3 01-Aug-2000 +PCRE version 3.4 22-Aug-2000 /-- Because of problems with Perl 5.6 in handling UTF-8 vs non UTF-8 --/ /-- strings automatically, do not use the \x{} construct except with --/ Index: ossp-pkg/pcre/pcre_test.d/testoutput6 RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput6,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/pcre/pcre_test.d/testoutput6,v' 2>/dev/null --- testoutput6 2000/08/02 09:46:09 1.1 +++ testoutput6 2000/08/29 19:24:19 1.2 @@ -1,4 +1,4 @@ -PCRE version 3.3 01-Aug-2000 +PCRE version 3.4 22-Aug-2000 /\x{100}/8DM Memory allocation (code space): 11 Index: ossp-pkg/pcre/pcreposix.c RCS File: /v/ossp/cvs/ossp-pkg/pcre/pcreposix.c,v rcsdiff -q -kk '-r1.3' '-r1.4' -u '/v/ossp/cvs/ossp-pkg/pcre/pcreposix.c,v' 2>/dev/null --- pcreposix.c 2000/08/02 09:46:06 1.3 +++ pcreposix.c 2000/08/29 19:24:17 1.4 @@ -83,7 +83,8 @@ REG_BADPAT, /* "POSIX collating elements are not supported" */ REG_INVARG, /* "this version of PCRE is not compiled with PCRE_UTF8 support" */ REG_BADPAT, /* "characters with values > 255 are not yet supported in classes" */ - REG_BADPAT /* "character value in \x{...} sequence is too large" */ + REG_BADPAT, /* "character value in \x{...} sequence is too large" */ + REG_BADPAT /* "invalid condition (?(0)" */ }; /* Table of texts corresponding to POSIX error codes */