From 5203fa2e22da9efb8a241153601357808041da85 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Wed, 13 Dec 2006 20:35:20 +0000 Subject: Fixed istream loading git-svn-id: http://pugixml.googlecode.com/svn/trunk@22 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/pugixml.cpp') diff --git a/src/pugixml.cpp b/src/pugixml.cpp index ebafd48..e150d17 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -238,7 +238,7 @@ namespace pugi xml_allocator& alloc; bool chartype_symbol_table[256]; - bool chartype_symbol(char c) { return chartype_symbol_table[(unsigned char)c]; } + bool chartype_symbol(char c) const { return chartype_symbol_table[(unsigned char)c]; } static bool chartype_space(char c) { return c < '!' && c > 0; } static bool chartype_enter(char c) { return c == '<'; } @@ -995,11 +995,6 @@ namespace pugi return find; } - namespace impl - { - int strcmpwild(const char* src, const char* dst); - } - // Wildcard pattern match. static int strcmpwild_astr(const char** src, const char** dst) { @@ -1934,6 +1929,9 @@ namespace pugi char* xml_parser::parse(char* xmlstr,unsigned int optmsk) { + if (xmlstr == _buffer) + _buffer = 0; + free(); if(!xmlstr) return 0; @@ -1951,6 +1949,9 @@ namespace pugi char* xml_parser::parse(const transfer_ownership_tag&, char* xmlstr,unsigned int optmsk) { + if (xmlstr == _buffer) + _buffer = 0; + free(); if(!xmlstr) return 0; -- cgit v1.2.3