commit | d0a38c3a206fe6efba605ff60e82683e64eccf89 | [log] [tgz] |
---|---|---|
author | Lee Thomason (grinliz) <leethomason@gmail.com> | Mon Apr 29 09:15:37 2013 -0700 |
committer | Lee Thomason (grinliz) <leethomason@gmail.com> | Mon Apr 29 09:15:37 2013 -0700 |
tree | 4eaff64ff25f40f524e64af3d7e24c2d0f02df90 | |
parent | 1377fe7ec002a53572f41a4f7ad88a3ddb0d5d47 [diff] [blame] |
fix BOM preservation bugs. add new tests
diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 3b38584..510de38 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp
@@ -1663,6 +1663,7 @@ XMLError XMLDocument::Parse( const char* p, size_t len ) { + const char* start = p; Clear(); if ( !p || !*p ) { @@ -1683,7 +1684,8 @@ return _errorID; } - ParseDeep( _charBuffer, 0 ); + int delta = p - start; // skip initial whitespace, BOM, etc. + ParseDeep( _charBuffer+delta, 0 ); return _errorID; }