Index: ext/libxml/libxml.c =================================================================== RCS file: /repository/php-src/ext/libxml/libxml.c,v retrieving revision 1.8 diff -u -r1.8 libxml.c --- ext/libxml/libxml.c 7 Nov 2003 19:12:46 -0000 1.8 +++ ext/libxml/libxml.c 1 Dec 2003 07:22:42 -0000 @@ -30,6 +30,7 @@ #define PHP_XML_INTERNAL #include "zend_variables.h" #include "ext/standard/php_string.h" +#include "ext/standard/php_smart_str.h" #include "ext/standard/info.h" #include "ext/standard/file.h" @@ -45,6 +46,7 @@ /* a true global for initialization */ int _php_libxml_initialized = 0; +smart_str _php_libxml_error_buffer; #ifdef ZTS int libxml_globals_id; @@ -304,11 +306,16 @@ va_end(ap); /* remove any trailing \n */ - while (len && buf[--len] == '\n') { + if (len && buf[--len] == '\n') { buf[len] = '\0'; + smart_str_appends(&_php_libxml_error_buffer, buf); + smart_str_0(&_php_libxml_error_buffer); + php_error(E_WARNING, "%s", _php_libxml_error_buffer.c); + smart_str_free(&_php_libxml_error_buffer); + } else { + smart_str_appends(&_php_libxml_error_buffer, buf); } - php_error(E_WARNING, "%s", buf); efree(buf); } @@ -344,6 +351,7 @@ if (_php_libxml_initialized) { /* reset libxml generic error handling */ xmlSetGenericErrorFunc(NULL, NULL); + smart_str_free(&_php_libxml_error_buffer); xmlCleanupParser(); _php_libxml_initialized = 0; }