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/mssql/php_mssql.c | |
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/mssql/php_mssql.c')
-rw-r--r-- | ext/mssql/php_mssql.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index 9930d3d0e4..9f8dd183b3 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -333,7 +333,7 @@ PHP_RINIT_FUNCTION(mssql) MS_SQL_G(default_link) = -1; MS_SQL_G(num_links) = MS_SQL_G(num_persistent); MS_SQL_G(appname) = estrndup("PHP 5", 5); - MS_SQL_G(server_message) = empty_string; + MS_SQL_G(server_message) = NULL; MS_SQL_G(min_error_severity) = MS_SQL_G(cfg_min_error_severity); MS_SQL_G(min_message_severity) = MS_SQL_G(cfg_min_message_severity); if (MS_SQL_G(connect_timeout) < 1) MS_SQL_G(connect_timeout) = 1; @@ -1045,7 +1045,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r result->fields[i].column_source = estrdup(source); } else { - result->fields[i].column_source = empty_string; + result->fields[i].column_source = STR_EMPTY_ALLOC(); } column_types[i] = coltype(i+1); @@ -1267,7 +1267,7 @@ PHP_FUNCTION(mssql_get_last_message) RETURN_STRING(MS_SQL_G(server_message),1); } else { - RETURN_STRING(empty_string,1); + RETURN_STRING("",1); } } |