diff options
author | Andi Gutmans <andi@php.net> | 2004-07-19 07:19:50 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2004-07-19 07:19:50 +0000 |
commit | 56f8195fe592e79d90c78fb015f39bffa7f39422 (patch) | |
tree | 6a1bf69bc9cd23fab98c4d3d6c12368b56d26079 /ext/sybase | |
parent | 599ae4b1b53d46e10447dab8fb4faa2d0517370a (diff) | |
download | php-git-56f8195fe592e79d90c78fb015f39bffa7f39422.tar.gz |
- Nuke empty_string. It is a reminanent from the time where RETURN_FALSE()
used to return "" and not bool(false). It's not worth keeping it because
STR_FREE() and zval_dtor() always have to check for it and it slows down
the general case. In addition, it seems that empty_string has been abused
quite a lot, and was used not only for setting zval's but generally in
PHP code instead of "", which wasn't the intention. Last but not least,
nuking empty_string should improve stability as I doubt every place
correctly checked if they are not mistakenly erealloc()'ing it or
calling efree() on it.
NOTE: Some code is probably broken. Each extension maintainer should
check and see that my changes are OK. Also, I haven't had time to touch
PECL yet. Will try and do it tomorrow.
Diffstat (limited to 'ext/sybase')
-rw-r--r-- | ext/sybase/php_sybase_db.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c index f2c98c7640..a6f0886f86 100644 --- a/ext/sybase/php_sybase_db.c +++ b/ext/sybase/php_sybase_db.c @@ -282,7 +282,7 @@ PHP_RINIT_FUNCTION(sybase) php_sybase_module.default_link=-1; php_sybase_module.num_links = php_sybase_module.num_persistent; php_sybase_module.appname = estrndup("PHP " PHP_VERSION, sizeof("PHP " PHP_VERSION)); - php_sybase_module.server_message = empty_string; + php_sybase_module.server_message = STR_EMPTY_ALLOC(); php_sybase_module.min_error_severity = php_sybase_module.cfg_min_error_severity; php_sybase_module.min_message_severity = php_sybase_module.cfg_min_message_severity; return SUCCESS; @@ -886,7 +886,7 @@ PHP_FUNCTION(sybase_query) result->fields[i].max_length = dbcollen(sybase_ptr->link,i+1); result->fields[i].column_source = estrdup(dbcolsource(sybase_ptr->link,i+1)); if (!result->fields[i].column_source) { - result->fields[i].column_source = empty_string; + result->fields[i].column_source = STR_EMPTY_ALLOC(); } Z_TYPE(result->fields[i]) = column_types[i]; /* set numeric flag */ |