mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-24 21:33:51 +03:00
fixed xmlGetProp to return "" when the attribute is NULL, Daniel.
This commit is contained in:
parent
726c7e3c8d
commit
6800ef354b
@ -1,3 +1,8 @@
|
||||
Mon Feb 8 19:27:56 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||
|
||||
* tree.c: fixed xmlGetProp to return "" when the attribute
|
||||
exists, even if the node-list is NULL.
|
||||
|
||||
Mon Feb 8 16:10:15 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
|
||||
|
||||
* tree.c: patched an error outputting empty attribute values.
|
||||
|
6
tree.c
6
tree.c
@ -2010,7 +2010,11 @@ CHAR *xmlGetProp(xmlNodePtr node, const CHAR *name) {
|
||||
|
||||
while (prop != NULL) {
|
||||
if (!xmlStrcmp(prop->name, name))
|
||||
return(xmlNodeListGetString(node->doc, prop->val, 1));
|
||||
CHAR *ret;
|
||||
|
||||
ret = xmlNodeListGetString(node->doc, prop->val, 1);
|
||||
if (ret == NULL) return(xmlStrdup(""));
|
||||
return(ret);
|
||||
prop = prop->next;
|
||||
}
|
||||
return(NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user