From 33c540664166e3b1e5de6975e6ca8484e8bd7f05 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Wed, 13 Dec 2006 20:38:38 +0000 Subject: Fixed istream parsing (again) git-svn-id: http://pugixml.googlecode.com/svn/trunk@23 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index e150d17..6ca3185 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -1919,19 +1919,16 @@ namespace pugi length = stream.tellg(); stream.seekg(pos, std::ios_base::beg); - _buffer = new char[length + 1]; - stream.read(_buffer, length); - _buffer[length] = 0; + char* s = new char[length + 1]; + stream.read(s, length); + s[length] = 0; - parse(_buffer, optmsk); // Parse the input string. + parse(transfer_ownership_tag(), s, optmsk); // Parse the input string. } #endif char* xml_parser::parse(char* xmlstr,unsigned int optmsk) { - if (xmlstr == _buffer) - _buffer = 0; - free(); if(!xmlstr) return 0; @@ -1949,9 +1946,6 @@ 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