summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-04-30 23:35:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-04-30 23:35:19 (GMT)
commit08adf78fbff30d213891a533fbf43d91816b166a (patch)
tree65f976e49f9fe3a1881caa304bcd8f395d36e6da /src
parentbec7fe8b2840838fe3a2620b8af29264d8b54e60 (diff)
Recovered from parsing errors against an empty XML file.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@524 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src')
-rw-r--r--src/common/xml.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/xml.c b/src/common/xml.c
index d01ae9b..1e2871b 100644
--- a/src/common/xml.c
+++ b/src/common/xml.c
@@ -145,7 +145,15 @@ void close_xml_file(xmlDocPtr xdoc, xmlXPathContextPtr context)
gboolean open_xml_file(const char *filename, xmlDoc **xdoc, xmlXPathContextPtr *xpathCtx)
{
- *xdoc = xmlParseFile(filename);
+ /**
+ * On s'autorise à récupérer des erreurs de fichier vide, ie ne contenant que :
+ *
+ * <?xml version="1.0" encoding="UTF-8"?>
+ *
+ * On espère que la récupération d'autres situations d'erreurs est bien gérée.
+ */
+
+ *xdoc = xmlReadFile(filename, NULL, XML_PARSE_RECOVER);
if (*xdoc == NULL)
{