projects
/
SXSI
/
XMLTree.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
.
[SXSI/XMLTree.git]
/
XMLTree.cpp
diff --git
a/XMLTree.cpp
b/XMLTree.cpp
index
3c51b2f
..
21658e9
100644
(file)
--- a/
XMLTree.cpp
+++ b/
XMLTree.cpp
@@
-311,8
+311,10
@@
treeNode XMLTree::Parent(treeNode x)
fprintf(stderr, "Error: data structure has not been constructed properly\n");
\r
exit(1);
\r
}
\r
fprintf(stderr, "Error: data structure has not been constructed properly\n");
\r
exit(1);
\r
}
\r
-
\r
- return parent(Par, x);
\r
+ if (x == Root())
\r
+ return NULLT;
\r
+ else
\r
+ return parent(Par, x);
\r
}
\r
\r
// Child(x,i): returns the i-th child of node x, assuming it exists.
\r
}
\r
\r
// Child(x,i): returns the i-th child of node x, assuming it exists.
\r