com php-src: windows fixes: ext/standard/string.c win32/build/config.w32 win32/registry.c

From: Date: Wed, 16 Oct 2013 09:30:27 +0000
Subject: com php-src: windows fixes: ext/standard/string.c win32/build/config.w32 win32/registry.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-73520@lists.php.net to get a copy of this message
Commit: 43e05efd3b5479846ef073b8426f709eeaad1bcd Author: Anatol Belski <ab@php.net> Thu, 4 Jul 2013 04:27:40 -0700 Parents: 2cf827b52a15fdb4468fbf004a4a286af0a1e73e Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=43e05efd3b5479846ef073b8426f709eeaad1bcd Log: windows fixes Changed paths: M ext/standard/string.c M win32/build/config.w32 M win32/registry.c Diff: diff --git a/ext/standard/string.c b/ext/standard/string.c index e21b53b..cd59954 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1409,7 +1409,7 @@ PHP_FUNCTION(strtolower) PHPAPI void php_basename(const char *s, zend_str_size_size_t len, char *suffix, zend_str_size_size_t sufflen, char **p_ret, zend_str_size_size_t *p_len TSRMLS_DC) { char *ret = NULL, *c, *comp, *cend; - zend_str_size inc_len, cnt; + zend_str_size_size_t inc_len, cnt; int state; c = comp = cend = (char*)s; diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 3401205..f2c6e3a 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -449,3 +449,9 @@ if (PHP_STATIC_ANALYZE == "yes") { ADD_FLAG("CFLAGS", " /analyze "); ADD_FLAG("CFLAGS", " /wd6308 "); } + +ARG_ENABLE("zstrlen", "Include Z_STRLEN macros enabling size_t for string length", "no"); +if (PHP_ZSTRLEN == "yes") { + AC_DEFINE('ZEND_USE_LEGACY_STRING_TYPES', 1, ""); +} + diff --git a/win32/registry.c b/win32/registry.c index 685a09d..f646a97 100644 --- a/win32/registry.c +++ b/win32/registry.c @@ -90,7 +90,7 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_ } INIT_PZVAL(data); Z_STRVAL_P(data) = zend_strndup(value, value_len-1); - Z_STRLEN_P(data) = value_len-1; + Z_STRSIZE_P(data) = value_len-1; Z_TYPE_P(data) = IS_STRING; zend_hash_update(ht, name, name_len+1, &data, sizeof(zval*), NULL); } @@ -261,7 +261,7 @@ void UpdateIniFromRegistry(char *path TSRMLS_DC) zend_hash_get_current_data_ex(ht, (void**)&data, &pos) == SUCCESS && zend_hash_get_current_key_ex(ht, &index, &index_len, &num, 0, &pos) == HASH_KEY_IS_STRING; zend_hash_move_forward_ex(ht, &pos)) { - zend_alter_ini_entry(index, index_len, Z_STRVAL_PP(data), Z_STRLEN_PP(data), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); + zend_alter_ini_entry(index, index_len, Z_STRVAL_PP(data), Z_STRSIZE_PP(data), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); } break; }

« previous php.cvs (#73520) next »