com php-src: Merge branch 'pull-request/1974' into PHP-5.6: ext/intl/grapheme/grapheme_string.c
| From: | Stanislav Malyshev | Date: | Sun, 27 Nov 2016 23:34:58 +0000 |
| Subject: | com php-src: Merge branch 'pull-request/1974' into PHP-5.6: ext/intl/grapheme/grapheme_string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96085@lists.php.net to get a copy of this message | ||
Commit: 8856b3a63c6b3eefe83aecaa9e18afb640173708
Author: Stanislav Malyshev <stas@php.net> Sun, 27 Nov 2016 15:11:17 -0800
Parents: 5049ef2f1c496c4964cd147e185c1f765ab0347b df683fa3b0a66d7626d6720858f309da9e7880e5
Branches: PHP-5.6 PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8856b3a63c6b3eefe83aecaa9e18afb640173708
Log:
Merge branch 'pull-request/1974' into PHP-5.6
* pull-request/1974:
Fix #68447: grapheme_extract take an extra trailing character
Bugs:
https://bugs.php.net/68447
Changed paths:
MM ext/intl/grapheme/grapheme_string.c
Diff:
diff --cc ext/intl/grapheme/grapheme_string.c
index 3ba9b51,8453f83..d298bab
--- a/ext/intl/grapheme/grapheme_string.c
+++ b/ext/intl/grapheme/grapheme_string.c
@@@ -810,11 -798,11 +798,11 @@@ static grapheme_extract_iter grapheme_e
Function to extract a sequence of default grapheme clusters */
PHP_FUNCTION(grapheme_extract)
{
-- unsigned char *str, *pstr;
- UChar *ustr;
- int str_len, ustr_len;
- long size; /* maximum number of grapheme clusters, bytes, or characters (based on extract_type)
to return */
- long lstart = 0; /* starting position in str in bytes */
++ char *str, *pstr;
+ UText ut = UTEXT_INITIALIZER;
- int str_len;
- long size; /* maximum number of grapheme clusters, bytes, or characters (based on extract_type)
to return */
- long lstart = 0; /* starting position in str in bytes */
++ size_t str_len;
++ zend_long size; /* maximum number of grapheme clusters, bytes, or characters (based on
extract_type) to return */
++ zend_long lstart = 0; /* starting position in str in bytes */
int32_t start = 0;
long extract_type = GRAPHEME_EXTRACT_TYPE_COUNT;
UErrorCode status;
@@@ -911,10 -896,7 +896,7 @@@
intl_error_set_code( NULL, status TSRMLS_CC );
/* Set error messages. */
-- intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0
TSRMLS_CC );
-
- if ( NULL != ustr )
- efree( ustr );
++ intl_error_set_custom_msg( NULL, "Error opening UTF-8 text", 0 TSRMLS_CC );
RETURN_FALSE;
}