From b62700e5dfd6b24f33e645c3ae0780777c610bf6 Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 9 Mar 2003 14:09:57 +0000 Subject: Stupid NPAQ bug.... --- lib/Input.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; } } -- cgit v1.2.3