diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2006-12-13 20:38:38 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2006-12-13 20:38:38 +0000 |
commit | 33c540664166e3b1e5de6975e6ca8484e8bd7f05 (patch) | |
tree | a11f98ac11da01d83b225998bf9094fff9815e6f | |
parent | 5203fa2e22da9efb8a241153601357808041da85 (diff) |
Fixed istream parsing (again)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@23 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r-- | src/pugixml.cpp | 14 |
1 files 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;
|