emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105704: * xml.c (parse_region): Make


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105704: * xml.c (parse_region): Make the parsing work for non-comment-starting XML files again.
Date: Sat, 10 Sep 2011 20:14:50 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105704
fixes bug(s): http://debbugs.gnu.org/9144
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Sat 2011-09-10 20:14:50 +0200
message:
  * xml.c (parse_region): Make the parsing work for non-comment-starting XML 
files again.
modified:
  src/ChangeLog
  src/xml.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-09-10 18:13:24 +0000
+++ b/src/ChangeLog     2011-09-10 18:14:50 +0000
@@ -1,3 +1,8 @@
+2011-09-10  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * xml.c (parse_region): Make the parsing work for
+       non-comment-starting XML files again (bug#9144).
+
 2011-09-10  Andreas Schwab  <address@hidden>
 
        * image.c (gif_load): Fix calculation of bottom and right corner.

=== modified file 'src/xml.c'
--- a/src/xml.c 2011-09-03 21:59:25 +0000
+++ b/src/xml.c 2011-09-10 18:14:50 +0000
@@ -124,6 +124,8 @@
 
   if (doc != NULL)
     {
+      /* If the document is just comments, then this should get us the
+        nodes anyway. */
       xmlNode *n = doc->children->next;
       Lisp_Object r = Qnil;
 
@@ -134,9 +136,13 @@
        n = n->next;
       }
 
-      if (NILP (result))
-       result = r;
-      else
+      if (NILP (result)) {
+       /* The document isn't just comments, so get the tree the
+          proper way. */
+       xmlNode *node = xmlDocGetRootElement (doc);
+       if (node != NULL)
+         result = make_dom (node);
+      } else
        result = Fcons (intern ("top"),
                        Fcons (Qnil, Fnreverse (Fcons (r, result))));
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]