summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2003-03-09 14:09:57 +0000
committerpixel <pixel>2003-03-09 14:09:57 +0000
commitb62700e5dfd6b24f33e645c3ae0780777c610bf6 (patch)
treea69a8b7e94683eda11613fd23c38f554bfaa7b6c
parent6f42565fe267a17221fa024cab35fde48a83947d (diff)
Stupid NPAQ bug....
-rw-r--r--lib/Input.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Input.cc b/lib/Input.cc
index f246f73..9697913 100644
--- a/lib/Input.cc
+++ b/lib/Input.cc
@@ -90,6 +90,9 @@ Input::Input(const String & no) throw (GeneralException) :
seek(0, SEEK_SET);
}
} else {
+#ifdef DEBUG
+ std::cerr << "Opening file in archive, position " << results.ptr << std::endl;
+#endif
size = results.size;
seek(results.ptr, SEEK_SET);
size = readU32();
@@ -382,11 +385,19 @@ void Archive::FileTree::touched() {
int Archive::FileTree::compute_ptrs(size_t cptr) {
ptr = cptr;
+#ifdef DEBUG
+ std::cerr << "Computed pointer for `" << name << "' = " << ptr << std::endl;
+ if (child)
+ std::cerr << "Node has child\n";
+ else
+ std::cerr << "Node is " << size << " bytes large.\n";
+#endif
+
if (child) {
FileTree * p;
size = 0;
for (p = child; p; p = p->next) {
- size += p->compute_ptrs(ptr + size) - ptr;
+ size = p->compute_ptrs(ptr + size) - ptr;
}
}