From f59b07f3adc29e838f36b44559f300385949111a Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Mon, 3 Aug 2009 13:26:15 +0000 Subject: [PATCH] - Improved. No ugly copy. (Tony) --- ext/standard/streamsfuncs.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index cc85c04431..72498921eb 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1735,32 +1735,24 @@ PHP_FUNCTION(stream_resolve_include_path) */ PHP_FUNCTION(stream_is_local) { - zval *zstream; + zval **zstream; php_stream *stream = NULL; php_stream_wrapper *wrapper = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zstream) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &zstream) == FAILURE) { RETURN_FALSE; } - if(Z_TYPE_P(zstream) == IS_RESOURCE) { - php_stream_from_zval(stream, &zstream); + if(Z_TYPE_PP(zstream) == IS_RESOURCE) { + php_stream_from_zval(stream, zstream); if(stream == NULL) { RETURN_FALSE; } wrapper = stream->wrapper; } else { - zval *copy_tmp; - - ALLOC_ZVAL(copy_tmp); - *copy_tmp = *zstream; - zval_copy_ctor(copy_tmp); - INIT_PZVAL(copy_tmp); - convert_to_string(copy_tmp); - - wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(copy_tmp), NULL, 0 TSRMLS_CC); + convert_to_string_ex(zstream); - zval_ptr_dtor(©_tmp); + wrapper = php_stream_locate_url_wrapper(Z_STRVAL_PP(zstream), NULL, 0 TSRMLS_CC); } if(!wrapper) { -- 2.40.0