diff --git a/src/finder.cpp b/src/finder.cpp index 87bced9716..2c195a1333 100644 --- a/src/finder.cpp +++ b/src/finder.cpp @@ -59,6 +59,11 @@ class DirectoryElement: public Element { const char* file = append(s, this->name, "/", name); System::Region* region; System::Status status = s->map(®ion, file); + + if (status) { + fprintf(stderr, "%s not found\n", file); + } + s->free(file); if (s->success(status)) { @@ -325,7 +330,7 @@ class JarIndex { class JarElement: public Element { public: JarElement(System* s, const char* name): - s(s), name(name) + s(s), name(name), region(0), index(0) { } void init() { @@ -401,12 +406,14 @@ parsePath(System* s, const char* path) Element* first = 0; Element* prev = 0; - for (Tokenizer t(path, ':'); t.hasMore();) { + for (Tokenizer t(path, s->pathSeparator()); t.hasMore();) { Tokenizer::Token token(t.next()); char* name = static_cast(s->allocate(token.length + 1)); memcpy(name, token.s, token.length); name[token.length] = 0; + fprintf(stderr, "path element: %s\n", name); + Element* e; switch (s->identify(name)) { case System::File: { diff --git a/src/posix.cpp b/src/posix.cpp index db9de2684b..67f2e26876 100644 --- a/src/posix.cpp +++ b/src/posix.cpp @@ -550,6 +550,10 @@ class MySystem: public System { } } + virtual char pathSeparator() { + return ':'; + } + virtual int64_t now() { timeval tv = { 0, 0 }; gettimeofday(&tv, 0); diff --git a/src/system.h b/src/system.h index 41fe2ddd0d..da6956c0c9 100644 --- a/src/system.h +++ b/src/system.h @@ -94,8 +94,9 @@ class System: public Allocator { virtual FileType identify(const char* name) = 0; virtual Status load(Library**, const char* name, bool mapName, Library* next) = 0; - virtual void exit(int code) = 0; + virtual char pathSeparator() = 0; virtual int64_t now() = 0; + virtual void exit(int code) = 0; virtual void abort() = 0; virtual void dispose() = 0; diff --git a/src/windows.cpp b/src/windows.cpp index 23274aa045..197ebda8a2 100644 --- a/src/windows.cpp +++ b/src/windows.cpp @@ -462,7 +462,7 @@ class MySystem: public System { virtual Status attach(Runnable* r) { Thread* t = new (System::allocate(sizeof(Thread))) Thread(this, r); - bool success = DuplicateHandle + bool success UNUSED = DuplicateHandle (GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &(t->thread), 0, false, DUPLICATE_SAME_ACCESS); assert(this, success); @@ -581,6 +581,9 @@ class MySystem: public System { } } + virtual char pathSeparator() { + return ';'; + } virtual int64_t now() { static LARGE_INTEGER frequency;