diff options
-rw-r--r-- | src/pugixml.cpp | 2 | ||||
-rw-r--r-- | tests/test_parse.cpp | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 59712ae..634192a 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -1903,6 +1903,8 @@ PUGI__NS_BEGIN } else if (*s == 0) { + *g.flush(s) = 0; + return s; } else ++s; diff --git a/tests/test_parse.cpp b/tests/test_parse.cpp index 6d9d4cc..eb8fefb 100644 --- a/tests/test_parse.cpp +++ b/tests/test_parse.cpp @@ -975,3 +975,10 @@ TEST(parse_bom_fragment_invalid_utf32) CHECK_STRING(value, "\xef\xbf\xbf"); #endif } + +TEST(parse_pcdata_gap_fragment) +{ + xml_document doc; + CHECK(doc.load(STR("a&b"), parse_fragment | parse_escapes)); + CHECK_STRING(doc.text().get(), STR("a&b")); +}
\ No newline at end of file |