diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-10-31 02:16:46 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-10-31 02:16:46 +0300 |
commit | 974a8f8ad2a0ed923abb5c63cfc7d73e2c81e21f (patch) | |
tree | a34da1c72e0c210def77b1b36e25d4c4232ed4ae /Zend/zend_ini.c | |
parent | 8482a6f51184c1c099a74c8252ca2b609f3b5ea7 (diff) | |
download | php-git-974a8f8ad2a0ed923abb5c63cfc7d73e2c81e21f.tar.gz |
Use internet strings for EG(ini_entries)
Diffstat (limited to 'Zend/zend_ini.c')
-rw-r--r-- | Zend/zend_ini.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index f585bba2d2..4c1f52d4af 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -157,13 +157,13 @@ static void copy_ini_entry(zval *zv) /* {{{ */ Z_PTR_P(zv) = new_entry; memcpy(new_entry, old_entry, sizeof(zend_ini_entry)); if (old_entry->name) { - new_entry->name = zend_string_init(ZSTR_VAL(old_entry->name), ZSTR_LEN(old_entry->name), 1); + new_entry->name = zend_string_dup(old_entry->name, 1); } if (old_entry->value) { - new_entry->value = zend_string_init(ZSTR_VAL(old_entry->value), ZSTR_LEN(old_entry->value), 1); + new_entry->value = zend_string_dup(old_entry->value, 1); } if (old_entry->orig_value) { - new_entry->orig_value = zend_string_init(ZSTR_VAL(old_entry->orig_value), ZSTR_LEN(old_entry->orig_value), 1); + new_entry->orig_value = zend_string_dup(old_entry->orig_value, 1); } } /* }}} */ @@ -231,7 +231,7 @@ ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int while (ini_entry->name) { p = pemalloc(sizeof(zend_ini_entry), 1); - p->name = zend_string_init(ini_entry->name, ini_entry->name_length, 1); + p->name = zend_string_init_interned(ini_entry->name, ini_entry->name_length, 1); p->on_modify = ini_entry->on_modify; p->mh_arg1 = ini_entry->mh_arg1; p->mh_arg2 = ini_entry->mh_arg2; @@ -255,10 +255,10 @@ ZEND_API int zend_register_ini_entries(const zend_ini_entry_def *ini_entry, int if (((default_value = zend_get_configuration_directive(p->name)) != NULL) && (!p->on_modify || p->on_modify(p, Z_STR_P(default_value), p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP) == SUCCESS)) { - p->value = zend_string_copy(Z_STR_P(default_value)); + p->value = zend_new_interned_string(zend_string_copy(Z_STR_P(default_value))); } else { p->value = ini_entry->value ? - zend_string_init(ini_entry->value, ini_entry->value_length, 1) : NULL; + zend_string_init_interned(ini_entry->value, ini_entry->value_length, 1) : NULL; if (p->on_modify) { p->on_modify(p, p->value, p->mh_arg1, p->mh_arg2, p->mh_arg3, ZEND_INI_STAGE_STARTUP); |