From 3838cd0e687011b9c590324f6722b73dbdeac459 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 21 Sep 2007 08:15:39 -0600 Subject: [PATCH] strip leading slashes from path in JarElement::find()/exists() --- src/finder.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/finder.cpp b/src/finder.cpp index e4f808c74b..87bced9716 100644 --- a/src/finder.cpp +++ b/src/finder.cpp @@ -302,6 +302,7 @@ class JarIndex { abort(s); } } + return 0; } @@ -339,11 +340,17 @@ class JarElement: public Element { virtual System::Region* find(const char* name) { init(); + + while (*name == '/') name++; + return (index ? index->find(name) : 0); } virtual bool exists(const char* name) { init(); + + while (*name == '/') name++; + return (index ? index->exists(name) : 0); }