From 9b450aad2327719d051e986549f0416e17b5dbff Mon Sep 17 00:00:00 2001 From: jhurst Date: Tue, 14 Oct 2014 00:14:39 +0000 Subject: [PATCH] comment insensitivity --- src/KM_xml.cpp | 25 +++++++++++++++++++++++-- src/TimedText_Parser.cpp | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/KM_xml.cpp b/src/KM_xml.cpp index c52d73a..dcb35a3 100644 --- a/src/KM_xml.cpp +++ b/src/KM_xml.cpp @@ -1067,8 +1067,29 @@ Kumu::GetXMLDocType(const byte_t* buf, ui32_t buf_len, std::string& ns_prefix, s break; } } + else if ( *p1 == '<' && ( ( p1 + 3 ) < end_p ) && p1[1] == '!' && p1[2] == '-' && p1[3] == '-' ) + { + p1 += 4; - ++p1; + for (;;) + { + while ( *p1 != '>' && p1 < end_p ) + { + ++p1; + } + + if ( *(p1-2) == '-' && *(p1-1) == '-' && *p1 == '>' ) + { + break; + } + + ++p1; + } + } + else + { + ++p1; + } } if ( isspace(*p2) ) @@ -1104,7 +1125,7 @@ Kumu::GetXMLDocType(const byte_t* buf, ui32_t buf_len, std::string& ns_prefix, s for ( i = doc_attr_nvpairs.begin(); i != doc_attr_nvpairs.end(); ++i ) { // trim leading and trailing whitespace an right-most character, i.e., \" - std::string trimmed = i->substr(i->find_first_not_of(" "), i->find_last_not_of(" ")); + std::string trimmed = i->substr(i->find_first_not_of(" "), i->find_last_not_of(" \r\n\t")); std::list nv_tokens = km_token_split(trimmed, "=\""); if ( nv_tokens.size() != 2 ) diff --git a/src/TimedText_Parser.cpp b/src/TimedText_Parser.cpp index ea5f0a9..e391694 100644 --- a/src/TimedText_Parser.cpp +++ b/src/TimedText_Parser.cpp @@ -78,7 +78,7 @@ ASDCP::TimedText::LocalFilenameResolver::ResolveRID(const byte_t* uuid, TimedTex if ( found_list.size() == 1 ) { FileReader Reader; - DefaultLogSink().Debug("retrieving resource %s from file %s\n", buf, found_list.front().c_str()); + DefaultLogSink().Debug("Retrieving resource %s from file %s\n", buf, found_list.front().c_str()); result = Reader.OpenRead(found_list.front().c_str()); -- 2.30.2