Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/Container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ void digidoc::initialize(const string &appInfo, const string &userAgent, initCal
m_userAgent = userAgent;

LIBXML_TEST_VERSION
xmlLineNumbersDefaultValue = 1;
xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
xmlSubstituteEntitiesDefault(1);
xmlIndentTreeOutput = 1;
if(xmlSecInit() < 0)
THROW("Error during initialisation of xmlsec.");
if(xmlSecCheckVersion() != 1)
Expand Down
10 changes: 5 additions & 5 deletions src/XMLDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,9 @@ struct XMLNode: public XMLElem<xmlNode>

XMLNode& operator=(sv text) noexcept
{
if(!d || text.empty())
if(!d)
return *this;
xmlChar *content = xmlEncodeSpecialChars(d->doc, pcxmlChar(text.data()));
xmlNodeSetContent(d, content);
xmlFree(content);
xmlNodeSetContent(d, pcxmlChar(text.data()));
return *this;
}

Expand Down Expand Up @@ -325,8 +323,10 @@ struct XMLDocument: public unique_xml_t<decltype(xmlFreeDoc)>, public XMLNode
return is->good() || is->eof() ? int(is->gcount()) : -1;
}, nullptr, &is, XML_CHAR_ENCODING_NONE), xmlFreeParserCtxt);
ctxt->linenumbers = 1;
ctxt->options |= XML_PARSE_NOENT|XML_PARSE_DTDLOAD|XML_PARSE_DTDATTR|XML_PARSE_NONET;
ctxt->loadsubset |= XML_DETECT_IDS|XML_COMPLETE_ATTRS;
if(hugeFile)
ctxt->options = XML_PARSE_HUGE;
ctxt->options |= XML_PARSE_HUGE;
auto result = xmlParseDocument(ctxt.get());
if(result != 0 || !ctxt->wellFormed)
THROW("%s", ctxt->lastError.message);
Expand Down