aboutsummaryrefslogtreecommitdiffstats
path: root/tree.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2004-11-02 18:45:30 +0000
committerDaniel Veillard <veillard@src.gnome.org>2004-11-02 18:45:30 +0000
commita03e36566be477c034d30ba78c2524c55c41bc71 (patch)
treef2eb5530b2d98bf1ebd1a93860c30aca13f717b5 /tree.c
parentd93f625ae90cafbd91b55b04408854a9b4b75192 (diff)
downloadandroid_external_libxml2-a03e36566be477c034d30ba78c2524c55c41bc71.tar.gz
android_external_libxml2-a03e36566be477c034d30ba78c2524c55c41bc71.tar.bz2
android_external_libxml2-a03e36566be477c034d30ba78c2524c55c41bc71.zip
more developments on the API testing more cleanups rebuilt Daniel
* gentest.py testapi.c: more developments on the API testing * HTMLparser.c tree.c: more cleanups * doc/*: rebuilt Daniel
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tree.c b/tree.c
index 1eea2688..87b158ea 100644
--- a/tree.c
+++ b/tree.c
@@ -2154,6 +2154,7 @@ xmlNewDocPI(xmlDocPtr doc, const xmlChar *name, const xmlChar *content) {
if (content != NULL) {
cur->content = xmlStrdup(content);
}
+ cur->doc = doc;
if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
@@ -3525,10 +3526,10 @@ xmlUnlinkNode(xmlNodePtr cur) {
*/
xmlNodePtr
xmlReplaceNode(xmlNodePtr old, xmlNodePtr cur) {
- if (old == NULL) {
+ if ((old == NULL) || (old->parent == NULL)) {
#ifdef DEBUG_TREE
xmlGenericError(xmlGenericErrorContext,
- "xmlReplaceNode : old == NULL\n");
+ "xmlReplaceNode : old == NULL or without parent\n");
#endif
return(NULL);
}