diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2013-03-21 19:23:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-01 21:33:29 +0200 |
commit | bb5552a22995ba1dbc4f9944e72a6b0e15194fcb (patch) | |
tree | 31a94ce99ebdf1a6e32ae30a78001661c70d89d2 /src/3rdparty/pcre/pcre_string_utils.c | |
parent | 34999402898886a969094a39587909ab6764e568 (diff) |
Upgrade the bundled PCRE to 8.32
Changelog: http://pcre.org/changelog.txt
Amongst other things, the Unicode tables were upgraded to 6.2.0
and case folding support was added, which also fixes a QString
autotest (marked as XFAIL).
Qt still requires 8.30, not 8.32.
Change-Id: I4056c1dc1d949d33443bb8ca280de4c8c363ac74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/3rdparty/pcre/pcre_string_utils.c')
-rw-r--r-- | src/3rdparty/pcre/pcre_string_utils.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/3rdparty/pcre/pcre_string_utils.c b/src/3rdparty/pcre/pcre_string_utils.c index d4545532a7..a9b4e77c00 100644 --- a/src/3rdparty/pcre/pcre_string_utils.c +++ b/src/3rdparty/pcre/pcre_string_utils.c @@ -81,6 +81,27 @@ while (*str1 != '\0' || *str2 != '\0') return 0; } +#ifdef COMPILE_PCRE32 + +int +PRIV(strcmp_uc_uc_utf)(const pcre_uchar *str1, const pcre_uchar *str2) +{ +pcre_uchar c1; +pcre_uchar c2; + +while (*str1 != '\0' || *str2 != '\0') + { + c1 = RAWUCHARINC(str1); + c2 = RAWUCHARINC(str2); + if (c1 != c2) + return ((c1 > c2) << 1) - 1; + } +/* Both length and characters must be equal. */ +return 0; +} + +#endif /* COMPILE_PCRE32 */ + int PRIV(strcmp_uc_c8)(const pcre_uchar *str1, const char *str2) { @@ -99,6 +120,28 @@ while (*str1 != '\0' || *ustr2 != '\0') return 0; } +#ifdef COMPILE_PCRE32 + +int +PRIV(strcmp_uc_c8_utf)(const pcre_uchar *str1, const char *str2) +{ +const pcre_uint8 *ustr2 = (pcre_uint8 *)str2; +pcre_uchar c1; +pcre_uchar c2; + +while (*str1 != '\0' || *ustr2 != '\0') + { + c1 = RAWUCHARINC(str1); + c2 = (pcre_uchar)*ustr2++; + if (c1 != c2) + return ((c1 > c2) << 1) - 1; + } +/* Both length and characters must be equal. */ +return 0; +} + +#endif /* COMPILE_PCRE32 */ + /* The following two functions compares two, fixed length strings. Basically an strncmp for non 8 bit characters. @@ -163,6 +206,6 @@ while (*str++ != 0) return len; } -#endif /* COMPILE_PCRE8 */ +#endif /* !COMPILE_PCRE8 */ /* End of pcre_string_utils.c */ |