From adbe74efbe92a0a7ab3bc07859185b6b1233db02 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 17 Jul 2011 19:48:12 -0600 Subject: [PATCH] add debug logging to finder.cpp --- src/finder.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/finder.cpp b/src/finder.cpp index 0bf0241af3..7257fa2603 100644 --- a/src/finder.cpp +++ b/src/finder.cpp @@ -18,6 +18,7 @@ using namespace vm; namespace { const bool DebugFind = false; +const bool DebugStat = false; class Element { public: @@ -138,6 +139,9 @@ class DirectoryElement: public Element { virtual System::FileType stat(const char* name, unsigned* length, bool) { const char* file = append(allocator, this->name, "/", name); System::FileType type = s->stat(file, length); + if (DebugStat) { + fprintf(stderr, "stat %s in %s: %d\n", name, this->name, type); + } allocator->free(file, strlen(file) + 1); return type; } @@ -492,8 +496,12 @@ class JarElement: public Element { while (*name == '/') name++; - return (index ? index->stat(name, length, tryDirectory) - : System::TypeDoesNotExist); + System::FileType type = (index ? index->stat(name, length, tryDirectory) + : System::TypeDoesNotExist); + if (DebugStat) { + fprintf(stderr, "stat %s in %s: %d\n", name, this->name, type); + } + return type; } virtual const char* urlPrefix() {