summaryrefslogtreecommitdiff
path: root/ext/pcre/pcrelib/pcreposix.c
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2007-06-15 19:09:26 +0000
committerNuno Lopes <nlopess@php.net>2007-06-15 19:09:26 +0000
commit4e51d2ec73ed84ba0ca2306f5eff8e7af10b97de (patch)
tree11823bd075dc6eb9c3983a2b2262759fdc94648a /ext/pcre/pcrelib/pcreposix.c
parent17db5db75992b14f8f7b4cfb2ac740d402c9619a (diff)
downloadphp-git-4e51d2ec73ed84ba0ca2306f5eff8e7af10b97de.tar.gz
upgrade PCRE to version 7.2 RC3
# I'll update to the final version early next week when its released
Diffstat (limited to 'ext/pcre/pcrelib/pcreposix.c')
-rw-r--r--ext/pcre/pcrelib/pcreposix.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/ext/pcre/pcrelib/pcreposix.c b/ext/pcre/pcrelib/pcreposix.c
index 3cee2aa33f..8582fba097 100644
--- a/ext/pcre/pcrelib/pcreposix.c
+++ b/ext/pcre/pcrelib/pcreposix.c
@@ -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-2006 University of Cambridge
+ Copyright (c) 1997-2007 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -80,7 +80,7 @@ static const int eint[] = {
REG_BADPAT, /* malformed number or name after (?( */
REG_BADPAT, /* conditional group contains more than two branches */
REG_BADPAT, /* assertion expected after (?( */
- REG_BADPAT, /* (?R or (?digits must be followed by ) */
+ REG_BADPAT, /* (?R or (?[+-]digits must be followed by ) */
REG_ECTYPE, /* unknown POSIX class name */
REG_BADPAT, /* POSIX collating elements are not supported */
REG_INVARG, /* this version of PCRE is not compiled with PCRE_UTF8 support */
@@ -108,7 +108,8 @@ static const int eint[] = {
REG_BADPAT, /* DEFINE group contains more than one branch */
REG_BADPAT, /* repeating a DEFINE group is not allowed */
REG_INVARG, /* inconsistent NEWLINE options */
- REG_BADPAT /* \g is not followed followed by an (optionally braced) non-zero number */
+ REG_BADPAT, /* \g is not followed followed by an (optionally braced) non-zero number */
+ REG_BADPAT /* (?+ or (?- must be followed by a non-zero number */
};
/* Table of texts corresponding to POSIX error codes */
@@ -141,7 +142,7 @@ static const char *const pstring[] = {
* Translate error code to string *
*************************************************/
-PCRE_DATA_SCOPE size_t
+PCREPOSIX_EXP_DEFN size_t
regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
{
const char *message, *addmessage;
@@ -158,7 +159,7 @@ addlength = (preg != NULL && (int)preg->re_erroffset != -1)?
if (errbuf_size > 0)
{
if (addlength > 0 && errbuf_size >= length + addlength)
- snprintf(errbuf, errbuf_size, "%s%s%-6d", message, addmessage, (int)preg->re_erroffset);
+ sprintf(errbuf, "%s%s%-6d", message, addmessage, (int)preg->re_erroffset);
else
{
strncpy(errbuf, message, errbuf_size - 1);
@@ -176,7 +177,7 @@ return length + addlength;
* Free store held by a regex *
*************************************************/
-PCRE_DATA_SCOPE void
+PCREPOSIX_EXP_DEFN void
regfree(regex_t *preg)
{
(pcre_free)(preg->re_pcre);
@@ -199,7 +200,7 @@ Returns: 0 on success
various non-zero codes on failure
*/
-PCRE_DATA_SCOPE int
+PCREPOSIX_EXP_DEFN int
regcomp(regex_t *preg, const char *pattern, int cflags)
{
const char *errorptr;
@@ -241,7 +242,7 @@ If REG_NOSUB was specified at compile time, the PCRE_NO_AUTO_CAPTURE flag will
be set. When this is the case, the nmatch and pmatch arguments are ignored, and
the only result is yes/no/error. */
-PCRE_DATA_SCOPE int
+PCREPOSIX_EXP_DEFN int
regexec(const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags)
{