strip leading slashes from path in JarElement::find()/exists()

This commit is contained in:
Joel Dice 2007-09-21 08:15:39 -06:00
parent 36f1d3206e
commit 3838cd0e68

View File

@ -302,6 +302,7 @@ class JarIndex {
abort(s); abort(s);
} }
} }
return 0; return 0;
} }
@ -339,11 +340,17 @@ class JarElement: public Element {
virtual System::Region* find(const char* name) { virtual System::Region* find(const char* name) {
init(); init();
while (*name == '/') name++;
return (index ? index->find(name) : 0); return (index ? index->find(name) : 0);
} }
virtual bool exists(const char* name) { virtual bool exists(const char* name) {
init(); init();
while (*name == '/') name++;
return (index ? index->exists(name) : 0); return (index ? index->exists(name) : 0);
} }