com php-src: update len in fallback cases: ext/intl/locale/loca le_methods.c

From: Date: Thu, 13 Oct 2016 23:49:55 +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-95051@lists.php.net to get a copy of this message
Commit: 6f9c3b45580a877c793832d60e5ce0f40cdf9e0c Author: Anatol Belski <ab@php.net> Wed, 12 Oct 2016 20:52:46 +0200 Parents: 2c38f70a94d49a5148c4fbddf04296d74a6b9b49 Branches: PHP-7.1 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6f9c3b45580a877c793832d60e5ce0f40cdf9e0c Log: update len in fallback cases (cherry picked from commit 58b18892bf3db0adf2a01f92adb4c907700fbbdd) 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 b75183d..e35da2f 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); @@ -1165,6 +1166,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); @@ -1270,6 +1272,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){ @@ -1553,8 +1556,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); } }

« previous php.cvs (#95051) next »