com php-src: update len in fallback cases: ext/intl/locale/loca le_methods.c
| From: | Anatol Belski | Date: | Wed, 12 Oct 2016 18:52:46 +0000 |
| Subject: | com php-src: update len in fallback cases: ext/intl/locale/loca le_methods.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94965@lists.php.net to get a copy of this message | ||
Commit: 58b18892bf3db0adf2a01f92adb4c907700fbbdd
Author: Anatol Belski <ab@php.net> Wed, 12 Oct 2016 20:52:46 +0200
Parents: 5aae01104f88f98f42fd997d360757651f7cc919
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=58b18892bf3db0adf2a01f92adb4c907700fbbdd
Log:
update len in fallback cases
Changed paths:
M ext/intl/locale/locale_methods.c
Diff:
diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
index eaf113a..18a051f 100644
--- a/ext/intl/locale/locale_methods.c
+++ b/ext/intl/locale/locale_methods.c
@@ -405,6 +405,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
+ loc_name_len = strlen(loc_name);
}
INTL_CHECK_LOCALE_LEN(loc_name_len);
@@ -1169,6 +1170,7 @@ PHP_FUNCTION(locale_get_all_variants)
if(loc_name_len == 0) {
loc_name = intl_locale_get_default();
+ loc_name_len = strlen(loc_name);
}
INTL_CHECK_LOCALE_LEN(loc_name_len);
@@ -1274,6 +1276,7 @@ PHP_FUNCTION(locale_filter_matches)
if(loc_range_len == 0) {
loc_range = intl_locale_get_default();
+ loc_range_len = strlen(loc_range);
}
if( strcmp(loc_range,"*")==0){
@@ -1557,8 +1560,10 @@ PHP_FUNCTION(locale_lookup)
if(loc_range_len == 0) {
if(fallback_loc_str) {
loc_range = ZSTR_VAL(fallback_loc_str);
+ loc_range_len = ZSTR_LEN(fallback_loc_str);
} else {
loc_range = intl_locale_get_default();
+ loc_range_len = strlen(loc_range);
}
}