Hi Marcus,

You broke tests in unicode mode.

Dmitry.

> -----Original Message-----
> From: Marcus Boerger [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 29, 2005 5:46 AM
> To: php-cvs@lists.php.net
> Subject: [PHP-CVS] cvs: php-src /ext/simplexml simplexml.c 
> 
> 
> helly         Mon Nov 28 21:46:20 2005 EDT
> 
>   Modified files:              
>     /php-src/ext/simplexml    simplexml.c 
>   Log:
>   - Fix some memleaks
>   
> http://cvs.php.net/diff.php/php-src/ext/simplexml/simplexml.c?
> r1=1.177&r2=1.178&ty=u
> Index: php-src/ext/simplexml/simplexml.c
> diff -u php-src/ext/simplexml/simplexml.c:1.177 
> php-src/ext/simplexml/simplexml.c:1.178
> --- php-src/ext/simplexml/simplexml.c:1.177   Sun Nov 20 08:03:15 2005
> +++ php-src/ext/simplexml/simplexml.c Mon Nov 28 21:46:19 2005
> @@ -18,7 +18,7 @@
>    
> +-------------------------------------------------------------
> ---------+
>  */
>  
> -/* $Id: simplexml.c,v 1.177 2005/11/20 13:03:15 helly Exp $ */
> +/* $Id: simplexml.c,v 1.178 2005/11/29 02:46:19 helly Exp $ */
>  
>  #ifdef HAVE_CONFIG_H
>  #include "config.h"
> @@ -746,10 +746,19 @@
>  }
>  /* }}} */
>  
> +static inline char * sxe_xmlNodeListGetString(xmlDocPtr doc, 
> xmlNodePtr 
> +list, int inLine) {
> +     xmlChar *tmp = xmlNodeListGetString(doc, list, inLine);
> +     char    *res = estrdup((char*)tmp);
> +
> +     xmlFree(tmp);
> +     
> +     return res;
> +}
> +
>  /* {{{ _get_base_node_value()
>   */
> -static void
> -_get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr 
> node, zval **value, char *prefix TSRMLS_DC)
> +static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr 
> +node, zval **value, char *prefix TSRMLS_DC)
>  {
>       php_sxe_object *subnode;
>       xmlChar        *contents;
> @@ -838,7 +847,7 @@
>               while (attr) {
>                       if ((!test || !xmlStrcmp(attr->name, 
> sxe->iter.name)) && match_ns(sxe, (xmlNodePtr)attr, 
> sxe->iter.nsprefix)) {
>                               MAKE_STD_ZVAL(value);
> -                             ZVAL_STRING(value, 
> xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, 
> attr->children, 1), 1);
> +                             ZVAL_STRING(value, 
> sxe_xmlNodeListGetString((xmlDocPtr) 
> +sxe->document->ptr, attr->children, 1), 0);
>                               namelen = xmlStrlen(attr->name) + 1;
>                               if (!zattr) {
>                                       MAKE_STD_ZVAL(zattr);
> @@ -856,7 +865,7 @@
>       if (node && sxe->iter.type != SXE_ITER_ATTRLIST) {
>               if (node->type == XML_ATTRIBUTE_NODE) {
>                       MAKE_STD_ZVAL(value);
> -                     
> ZVAL_U_STRING(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), 
> value, xmlNodeListGetString(node->doc, node->children, 1), 1);
> +                     ZVAL_STRING(value, 
> sxe_xmlNodeListGetString(node->doc, 
> +node->children, 1), 0);
>                       zend_hash_next_index_insert(rv, &value, 
> sizeof(zval *), NULL);
>                       node = NULL;
>               } else {
> @@ -869,7 +878,7 @@
>                       } else {
>                               if (node->type == XML_TEXT_NODE) {
>                                       MAKE_STD_ZVAL(value);
> -                                     
> ZVAL_U_STRING(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), 
> value, xmlNodeListGetString(node->doc, node, 1), 1);
> +                                     ZVAL_STRING(value, 
> sxe_xmlNodeListGetString(node->doc, node, 1), 
> +0);
>                                       
> zend_hash_next_index_insert(rv, &value, sizeof(zval *), NULL);
>                                       goto next_iter;
>                               }
> @@ -2020,7 +2029,7 @@
>  {
>       php_info_print_table_start();
>       php_info_print_table_header(2, "Simplexml support", "enabled");
> -     php_info_print_table_row(2, "Revision", "$Revision: 1.177 $");
> +     php_info_print_table_row(2, "Revision", "$Revision: 1.178 $");
>       php_info_print_table_row(2, "Schema support",
>  #ifdef LIBXML_SCHEMAS_ENABLED
>               "enabled");
> 
> -- 
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to