[gxml/wip/ricotz/tests] XParser: MatchInfo.fetch_named() returns an empty string for no result




commit 8895704957809fa578bf6c270ee29657e8de6471
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Jul 17 13:16:59 2021 +0200

    XParser: MatchInfo.fetch_named() returns an empty string for no result

 gxml/XParser.vala | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gxml/XParser.vala b/gxml/XParser.vala
index 67ab0fa2..ba5c0d1b 100644
--- a/gxml/XParser.vala
+++ b/gxml/XParser.vala
@@ -428,8 +428,10 @@ public class GXml.XParser : GLib.Object, GXml.Parser {
                                return false;
                        }
                        string pid = info.fetch_named ("pid");
+                       if (pid == "") pid = null;
                        if (pid != null) pid = pid.replace ("\"","").chomp ().strip ();
                        string sid = info.fetch_named ("sid");
+                       if (sid == "") sid = null;
                        if (sid != null) sid = sid.replace ("\"","").chomp ().strip ();
       n = new GXml.DocumentType (_document, tr.const_local_name (), pid, sid);
       parent.append_child (n);


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