author | ecalot
<ecalot> 2005-12-24 00:36:23 UTC |
committer | ecalot
<ecalot> 2005-12-24 00:36:23 UTC |
parent | 2769880a07883b01533b1d30cda2212cfa19b75f |
PR/src/lib/xml/tree.c | +7 | -10 |
PR/src/lib/xml/unknown.c | +7 | -10 |
diff --git a/PR/src/lib/xml/tree.c b/PR/src/lib/xml/tree.c index 5370f66..3994fb3 100644 --- a/PR/src/lib/xml/tree.c +++ b/PR/src/lib/xml/tree.c @@ -94,7 +94,7 @@ static struct { void rec_tree(tTag* *t,const char* file) { tTag* aux=*t; tTag* aux2; - + if (*t && (*t)->file) { if (equalsIgnoreCase((aux->file),file)) { if (aux->child) { @@ -103,21 +103,19 @@ void rec_tree(tTag* *t,const char* file) { for(aux2=*t;aux2->next;aux2=aux2->next); /* go to the last child */ aux2->next=aux->next; /* and set the next siebling as the parent next siebling */ } - aux->next=NULL; aux->child=NULL; - /* freeTag(aux); */ } else { - if (*t) rec_tree(t,file); + *t=aux->next; } + aux->next=NULL; + /* freeTag(aux); */ + if (*t) rec_tree(t,file); } else { - if ((*t) && (*t)->next) - rec_tree(&((*t)->next),file); + if ((*t) && (*t)->next) rec_tree(&((*t)->next),file); } } - if ((*t) && (*t)->child) - rec_tree(&((*t)->child),file); - + if ((*t) && (*t)->child) rec_tree(&((*t)->child),file); } void unknown_deletetreefile(const char* file) { @@ -126,7 +124,6 @@ void unknown_deletetreefile(const char* file) { if (unknownFile.tree) rec_tree(&(unknownFile.tree->child),file); - showTag(0,unknownFile.tree); } diff --git a/PR/src/lib/xml/unknown.c b/PR/src/lib/xml/unknown.c index 5370f66..3994fb3 100644 --- a/PR/src/lib/xml/unknown.c +++ b/PR/src/lib/xml/unknown.c @@ -94,7 +94,7 @@ static struct { void rec_tree(tTag* *t,const char* file) { tTag* aux=*t; tTag* aux2; - + if (*t && (*t)->file) { if (equalsIgnoreCase((aux->file),file)) { if (aux->child) { @@ -103,21 +103,19 @@ void rec_tree(tTag* *t,const char* file) { for(aux2=*t;aux2->next;aux2=aux2->next); /* go to the last child */ aux2->next=aux->next; /* and set the next siebling as the parent next siebling */ } - aux->next=NULL; aux->child=NULL; - /* freeTag(aux); */ } else { - if (*t) rec_tree(t,file); + *t=aux->next; } + aux->next=NULL; + /* freeTag(aux); */ + if (*t) rec_tree(t,file); } else { - if ((*t) && (*t)->next) - rec_tree(&((*t)->next),file); + if ((*t) && (*t)->next) rec_tree(&((*t)->next),file); } } - if ((*t) && (*t)->child) - rec_tree(&((*t)->child),file); - + if ((*t) && (*t)->child) rec_tree(&((*t)->child),file); } void unknown_deletetreefile(const char* file) { @@ -126,7 +124,6 @@ void unknown_deletetreefile(const char* file) { if (unknownFile.tree) rec_tree(&(unknownFile.tree->child),file); - showTag(0,unknownFile.tree); }