aboutsummaryrefslogtreecommitdiffstats
path: root/src/xml.c
diff options
context:
space:
mode:
authorJoakim Verona2011-09-14 11:45:59 +0200
committerJoakim Verona2011-09-14 11:45:59 +0200
commit8d07d23ecd32b9e9f07234313c2e712a8c42b524 (patch)
treed5d925a00733d9a6d1f637b8f3dfdd40c33a2fe7 /src/xml.c
parent8918dacdb34e848edcd894e32de5b7b4e2fa19ea (diff)
parent46888499da0bb61ce47d339275d5a0c757a02eb2 (diff)
downloademacs-8d07d23ecd32b9e9f07234313c2e712a8c42b524.tar.gz
emacs-8d07d23ecd32b9e9f07234313c2e712a8c42b524.zip
upstream
Diffstat (limited to 'src/xml.c')
-rw-r--r--src/xml.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/xml.c b/src/xml.c
index 8b485e73649..f0422875f7e 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -124,6 +124,8 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html
124 124
125 if (doc != NULL) 125 if (doc != NULL)
126 { 126 {
127 /* If the document is just comments, then this should get us the
128 nodes anyway. */
127 xmlNode *n = doc->children->next; 129 xmlNode *n = doc->children->next;
128 Lisp_Object r = Qnil; 130 Lisp_Object r = Qnil;
129 131
@@ -134,9 +136,13 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html
134 n = n->next; 136 n = n->next;
135 } 137 }
136 138
137 if (NILP (result)) 139 if (NILP (result)) {
138 result = r; 140 /* The document isn't just comments, so get the tree the
139 else 141 proper way. */
142 xmlNode *node = xmlDocGetRootElement (doc);
143 if (node != NULL)
144 result = make_dom (node);
145 } else
140 result = Fcons (intern ("top"), 146 result = Fcons (intern ("top"),
141 Fcons (Qnil, Fnreverse (Fcons (r, result)))); 147 Fcons (Qnil, Fnreverse (Fcons (r, result))));
142 148