summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornigel <nigel@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-02-24 21:38:25 +0000
committernigel <nigel@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-02-24 21:38:25 +0000
commit5b147ef568d14b173955c93d7cc4137703d7ac0a (patch)
treef53a59b1bac518b16e3219d79d4db9e0bc70bc34
parent67741e1934bcbb6e8ceb2a75a5c6f7f14ae28438 (diff)
downloadpcre-5b147ef568d14b173955c93d7cc4137703d7ac0a.tar.gz
Load pcre-1.06 into code/trunk.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@15 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog8
-rw-r--r--internal.h4
-rw-r--r--maketables.c2
-rw-r--r--pcre.32
-rw-r--r--pcre.c19
-rw-r--r--pcre.h12
-rw-r--r--pcreposix.32
-rw-r--r--pcreposix.c4
-rw-r--r--pcreposix.h12
-rw-r--r--pgrep.12
-rw-r--r--study.c2
-rw-r--r--testinput3
-rw-r--r--testoutput6
-rw-r--r--testoutput22
14 files changed, 61 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index a893116..7c8e93a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,14 @@ ChangeLog for PCRE
------------------
+Version 1.06 23-Jan-98
+----------------------
+
+1. Added Markus Oberhumer's little patches for C++.
+
+2. Literal strings longer than 255 characters were broken.
+
+
Version 1.05 23-Dec-97
----------------------
diff --git a/internal.h b/internal.h
index 5951752..e9d9a76 100644
--- a/internal.h
+++ b/internal.h
@@ -3,7 +3,7 @@
*************************************************/
-#define PCRE_VERSION "1.05 23-Dec-1997"
+#define PCRE_VERSION "1.06 23-Jan-1998"
/* This is a library of functions to support regular expressions whose syntax
@@ -12,7 +12,7 @@ the file Tech.Notes for some information on the internals.
Written by: Philip Hazel <ph10@cam.ac.uk>
- Copyright (c) 1997 University of Cambridge
+ Copyright (c) 1998 University of Cambridge
-----------------------------------------------------------------------------
Permission is granted to anyone to use this software for any purpose on any
diff --git a/maketables.c b/maketables.c
index 26a1319..4566c36 100644
--- a/maketables.c
+++ b/maketables.c
@@ -8,7 +8,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by: Philip Hazel <ph10@cam.ac.uk>
- Copyright (c) 1997 University of Cambridge
+ Copyright (c) 1998 University of Cambridge
-----------------------------------------------------------------------------
Permission is granted to anyone to use this software for any purpose on any
diff --git a/pcre.3 b/pcre.3
index dc6f6ca..257e710 100644
--- a/pcre.3
+++ b/pcre.3
@@ -1014,4 +1014,4 @@ Cambridge CB2 3QG, England.
.br
Phone: +44 1223 334714
-Copyright (c) 1997 University of Cambridge.
+Copyright (c) 1998 University of Cambridge.
diff --git a/pcre.c b/pcre.c
index 81532c8..b3b0c95 100644
--- a/pcre.c
+++ b/pcre.c
@@ -9,7 +9,7 @@ the file Tech.Notes for some information on the internals.
Written by: Philip Hazel <ph10@cam.ac.uk>
- Copyright (c) 1997 University of Cambridge
+ Copyright (c) 1998 University of Cambridge
-----------------------------------------------------------------------------
Permission is granted to anyone to use this software for any purpose on any
@@ -49,10 +49,17 @@ the external pcre header. */
#include "internal.h"
+/* Allow compilation as C++ source code, should anybody want to do that. */
+
+#ifdef __cplusplus
+#define class pcre_class
+#endif
+
+
/* Min and max values for the common repeats; for the maxima, 0 => infinity */
-static char rep_min[] = { 0, 0, 1, 1, 0, 0 };
-static char rep_max[] = { 0, 0, 0, 0, 1, 1 };
+static const char rep_min[] = { 0, 0, 1, 1, 0, 0 };
+static const char rep_max[] = { 0, 0, 0, 0, 1, 1 };
/* Text forms of OP_ values and things, for debugging (not all used) */
@@ -76,7 +83,7 @@ are simple data values; negative values are for special things like \d and so
on. Zero means further processing is needed (for things like \x), or the escape
is invalid. */
-static short int escapes[] = {
+static const short int escapes[] = {
0, 0, 0, 0, 0, 0, 0, 0, /* 0 - 7 */
0, 0, ':', ';', '<', '=', '>', '?', /* 8 - ? */
'@', -ESC_A, -ESC_B, 0, -ESC_D, 0, 0, 0, /* @ - G */
@@ -1296,7 +1303,7 @@ for (;; ptr++)
the next state. */
previous[1] = length;
- ptr--;
+ if (length < 255) ptr--;
break;
}
} /* end of big loop */
@@ -3450,7 +3457,7 @@ ocount = offsetcount & (-2);
if (re->top_backref > 0 && re->top_backref >= ocount/2)
{
ocount = re->top_backref * 2 + 2;
- match_block.offset_vector = (pcre_malloc)(ocount * sizeof(int));
+ match_block.offset_vector = (int *)(pcre_malloc)(ocount * sizeof(int));
if (match_block.offset_vector == NULL) return PCRE_ERROR_NOMEMORY;
using_temporary_offsets = TRUE;
DPRINTF(("Got memory to hold back references\n"));
diff --git a/pcre.h b/pcre.h
index c82b73a..e4355eb 100644
--- a/pcre.h
+++ b/pcre.h
@@ -2,7 +2,7 @@
* Perl-Compatible Regular Expressions *
*************************************************/
-/* Copyright (c) 1997 University of Cambridge */
+/* Copyright (c) 1998 University of Cambridge */
#ifndef _PCRE_H
#define _PCRE_H
@@ -13,6 +13,12 @@ it is needed here for malloc. */
#include <sys/types.h>
#include <stdlib.h>
+/* Allow for C++ users */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Options */
#define PCRE_CASELESS 0x0001
@@ -55,4 +61,8 @@ extern int pcre_info(const pcre *, int *, int *);
extern pcre_extra *pcre_study(const pcre *, int, const char **);
extern const char *pcre_version(void);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* End of pcre.h */
diff --git a/pcreposix.3 b/pcreposix.3
index 2c907e7..017b977 100644
--- a/pcreposix.3
+++ b/pcreposix.3
@@ -132,4 +132,4 @@ Cambridge CB2 3QG, England.
.br
Phone: +44 1223 334714
-Copyright (c) 1997 University of Cambridge.
+Copyright (c) 1998 University of Cambridge.
diff --git a/pcreposix.c b/pcreposix.c
index 00f9dc7..649399e 100644
--- a/pcreposix.c
+++ b/pcreposix.c
@@ -12,7 +12,7 @@ functions.
Written by: Philip Hazel <ph10@cam.ac.uk>
- Copyright (c) 1997 University of Cambridge
+ Copyright (c) 1998 University of Cambridge
-----------------------------------------------------------------------------
Permission is granted to anyone to use this software for any purpose on any
@@ -212,7 +212,7 @@ int options = 0;
if ((eflags & REG_NOTBOL) != 0) options |= PCRE_NOTBOL;
if ((eflags & REG_NOTEOL) != 0) options |= PCRE_NOTEOL;
-preg->re_erroffset = -1; /* Only has meaning after compile */
+preg->re_erroffset = (size_t)(-1); /* Only has meaning after compile */
rc = pcre_exec(preg->re_pcre, NULL, string, (int)strlen(string), options,
(int *)pmatch, nmatch * 2);
diff --git a/pcreposix.h b/pcreposix.h
index 1d0f16a..91636aa 100644
--- a/pcreposix.h
+++ b/pcreposix.h
@@ -2,7 +2,7 @@
* Perl-Compatible Regular Expressions *
*************************************************/
-/* Copyright (c) 1997 University of Cambridge */
+/* Copyright (c) 1998 University of Cambridge */
#ifndef _PCREPOSIX_H
#define _PCREPOSIX_H
@@ -15,6 +15,12 @@ be there. I hope. */
#include <stdlib.h>
+/* Allow for C++ users */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Options defined by POSIX. */
#define REG_ICASE 0x01
@@ -69,4 +75,8 @@ extern int regexec(regex_t *, const char *, size_t, regmatch_t *, int);
extern size_t regerror(int, const regex_t *, char *, size_t);
extern void regfree(regex_t *);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* End of pcreposix.h */
diff --git a/pgrep.1 b/pgrep.1
index 6df6775..da1744d 100644
--- a/pgrep.1
+++ b/pgrep.1
@@ -69,4 +69,4 @@ for syntax errors or inacessible files (even if matches were found).
.SH AUTHOR
Philip Hazel <ph10@cam.ac.uk>
.br
-Copyright (c) 1997 University of Cambridge.
+Copyright (c) 1998 University of Cambridge.
diff --git a/study.c b/study.c
index 2291b73..e81d41f 100644
--- a/study.c
+++ b/study.c
@@ -9,7 +9,7 @@ the file Tech.Notes for some information on the internals.
Written by: Philip Hazel <ph10@cam.ac.uk>
- Copyright (c) 1997 University of Cambridge
+ Copyright (c) 1998 University of Cambridge
-----------------------------------------------------------------------------
Permission is granted to anyone to use this software for any purpose on any
diff --git a/testinput b/testinput
index 6dee4dc..19a971b 100644
--- a/testinput
+++ b/testinput
@@ -1591,4 +1591,7 @@
aaaabcd
aaAabcd
+/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/
+ \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377
+
/ End of test input /
diff --git a/testoutput b/testoutput
index 66b0e0a..7763398 100644
--- a/testoutput
+++ b/testoutput
@@ -1,5 +1,5 @@
Testing Perl-Compatible Regular Expressions
-PCRE version 1.05 23-Dec-1997
+PCRE version 1.06 23-Jan-1998
/the quick brown fox/
the quick brown fox
@@ -2366,5 +2366,9 @@ No match
aaAabcd
0: b
+/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/
+ \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377
+ 0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff
+
/ End of test input /
diff --git a/testoutput2 b/testoutput2
index bc1d6b5..63592a6 100644
--- a/testoutput2
+++ b/testoutput2
@@ -1,5 +1,5 @@
Testing Perl-Compatible Regular Expressions
-PCRE version 1.05 23-Dec-1997
+PCRE version 1.06 23-Jan-1998
/(a)b|/
Identifying subpattern count = 1