Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37842184
en ru br
ALT Linux repositórios
S:2.0.7-alt1

Group :: Desenvolvimento/GNOME E GTK+
RPM: itstool

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: itstool-2.0.4-up-d3adf026.patch
Download


commit d3adf0264ee2b6fd28b7eff7dec33501d6e75a7c
Author: Shaun McCance <shaunm@redhat.com>
Date:   Wed Oct 11 23:12:38 2017 -0400
    Fix massive performance issue
    
    Fixed https://github.com/itstool/itstool/issues/15
diff --git a/itstool.in b/itstool.in
index 60f73dd..c1d0585 100755
--- a/itstool.in
+++ b/itstool.in
@@ -553,6 +553,9 @@ class Document (object):
         self._itst_credits = None
         self._its_externals = {}
 
+    def __del__ (self):
+        self._doc.freeDoc()
+
     def _check_errors(self):
         if self._xml_err:
             raise libxml2.parserError(self._xml_err)
@@ -1039,8 +1042,11 @@ class Document (object):
         ctxt = libxml2.createDocParserCtxt(blurb)
         if self._load_dtd:
             ctxt.loadSubset(1)
-        ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
-        ctxt.replaceEntities(0)
+        if self._keep_entities:
+            ctxt.ctxtUseOptions(libxml2.XML_PARSE_DTDLOAD)
+            ctxt.replaceEntities(0)
+        else:
+            ctxt.replaceEntities(1)
         ctxt.parseDocument()
         trnode = ctxt.doc().getRootElement()
         try:
@@ -1082,6 +1088,7 @@ class Document (object):
         retnode = node.copyNode(2)
         for child in xml_child_iter(trnode):
             retnode.addChild(child.copyNode(1))
+        ctxt.doc().freeDoc()
         return retnode
 
     def generate_messages(self, comments=True):
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009