summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2010-01-04 16:19:17 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2010-01-04 16:19:17 +0000
commitc8d5b000f7e456ab3fddf095d33e4af8b848854b (patch)
tree080441ccfb2c2dd5fb3e8f51fdbf8ac090f90395
parent85793c7d127584777548ffbe263a0dcaf2d34368 (diff)
downloadpcre-c8d5b000f7e456ab3fddf095d33e4af8b848854b.tar.gz
Fix some discrepancies between "USPTR" and "unsigned char *".
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@483 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog14
-rw-r--r--pcre_compile.c2
-rw-r--r--pcre_internal.h8
3 files changed, 17 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 87feb0e..b27d121 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,7 +90,19 @@ Version 8.01 11-Dec-09
used.
14. Change 8.00/11 was not quite complete: code had been accidentally omitted,
- causing partial matching to fail where the end of the subject matched \W.
+ causing partial matching to fail when the end of the subject matched \W
+ in a UTF-8 pattern where \W was quantified with a minimum of 3.
+
+15. There were some discrepancies between the declarations in pcre_internal.h
+ of _pcre_is_newline(), _pcre_was_newline(), and _pcre_valid_utf8() and
+ their definitions. The declarations used "const uschar *" and the
+ definitions used USPTR. Even though USPTR is normally defined as "const
+ unsigned char *" (and uschar is typedeffed as "unsigned char"), it was
+ reported that: "This difference in casting confuses some C++ compilers, for
+ example, SunCC recognizes above declarations as different functions and
+ generates broken code for hbpcre." I have changed the declarations to use
+ USPTR.
+
diff --git a/pcre_compile.c b/pcre_compile.c
index 2065829..c1ad784 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -6449,7 +6449,7 @@ while (ptr[skipatstart] == CHAR_LEFT_PARENTHESIS &&
#ifdef SUPPORT_UTF8
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 &&
- (*erroroffset = _pcre_valid_utf8((uschar *)pattern, -1)) >= 0)
+ (*erroroffset = _pcre_valid_utf8((USPTR)pattern, -1)) >= 0)
{
errorcode = ERR44;
goto PCRE_EARLY_ERROR_RETURN2;
diff --git a/pcre_internal.h b/pcre_internal.h
index 28cbab2..48fd431 100644
--- a/pcre_internal.h
+++ b/pcre_internal.h
@@ -1753,14 +1753,12 @@ one of the exported public functions. They have to be "external" in the C
sense, but are not part of the PCRE public API. */
extern const uschar *_pcre_find_bracket(const uschar *, BOOL, int);
-extern BOOL _pcre_is_newline(const uschar *, int, const uschar *,
- int *, BOOL);
+extern BOOL _pcre_is_newline(USPTR, int, USPTR, int *, BOOL);
extern int _pcre_ord2utf8(int, uschar *);
extern real_pcre *_pcre_try_flipped(const real_pcre *, real_pcre *,
const pcre_study_data *, pcre_study_data *);
-extern int _pcre_valid_utf8(const uschar *, int);
-extern BOOL _pcre_was_newline(const uschar *, int, const uschar *,
- int *, BOOL);
+extern int _pcre_valid_utf8(USPTR, int);
+extern BOOL _pcre_was_newline(USPTR, int, USPTR, int *, BOOL);
extern BOOL _pcre_xclass(int, const uschar *);