[gupnp/gupnp-0.18] Only show libxml2 console messages in debug mode



commit 7010c3503375d1d33cdfac55f2fb3f507684628b
Author: Jens Georg <mail jensge org>
Date:   Sat Jun 30 21:21:21 2012 +0200

    Only show libxml2 console messages in debug mode
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679204

 libgupnp/gupnp-xml-doc.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/libgupnp/gupnp-xml-doc.c b/libgupnp/gupnp-xml-doc.c
index 8d712a9..0efc228 100644
--- a/libgupnp/gupnp-xml-doc.c
+++ b/libgupnp/gupnp-xml-doc.c
@@ -102,11 +102,16 @@ gupnp_xml_doc_new_from_path (const char *path,
                              GError    **error)
 {
         xmlDoc *doc;
+        int flags;
+
+        flags = XML_PARSE_PEDANTIC;
+
+        if (!g_getenv ("GUPNP_DEBUG")) {
+                flags |= XML_PARSE_NOWARNING | XML_PARSE_NOERROR;
+        }
 
         g_return_val_if_fail (path != NULL, NULL);
-        doc = xmlReadFile (path,
-                           NULL,
-                           XML_PARSE_PEDANTIC);
+        doc = xmlReadFile (path, NULL, flags);
         if (doc == NULL) {
                 g_set_error (error,
                              GUPNP_XML_ERROR,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]