From a2249c1304564c96ddd1c052043f8d5ef53e2112 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Tue, 20 Oct 2009 20:25:13 +0000 Subject: Removed dead code (UTF8 sequences of length 5 are considered broken, removed dead branch in PI parsing) git-svn-id: http://pugixml.googlecode.com/svn/trunk@161 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 1061447..9ae757b 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -409,7 +409,6 @@ namespace else if (*str < 0xE0) length = 2; else if (*str < 0xF0) length = 3; else if (*str < 0xF8) length = 4; - else if (*str < 0xFC) length = 5; else { ch = ' '; @@ -421,9 +420,6 @@ namespace // Scary scary fall throughs. switch (length) { - case 5: - ch <<= 6; - ch += (*str++ & UTF8_BYTE_MASK_READ); case 4: ch <<= 6; ch += (*str++ & UTF8_BYTE_MASK_READ); @@ -972,14 +968,11 @@ namespace cursor->name = mark; } - if (is_chartype(ch, ct_space)) - { - SKIPWS(); - CHECK_ERROR(status_bad_pi, s); + // ch is a whitespace character, skip whitespaces + SKIPWS(); + CHECK_ERROR(status_bad_pi, s); - mark = s; - } - else mark = 0; + mark = s; SCANFOR(*s == '?' && *(s+1) == '>'); // Look for '?>'. CHECK_ERROR(status_bad_pi, s); -- cgit v1.2.3