diff --git a/src/common/FSNodeZIP.cxx b/src/common/FSNodeZIP.cxx index c49f8359f..7bd88efc0 100644 --- a/src/common/FSNodeZIP.cxx +++ b/src/common/FSNodeZIP.cxx @@ -126,6 +126,21 @@ void FilesystemNodeZIP::setFlags(const string& zipfile, _error = zip_error::NOT_READABLE; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool FilesystemNodeZIP::exists() const +{ + if(_realNode && _realNode->exists()) + { + // We need to inspect the actual path, not just the ZIP file itself + myZipHandler->open(_zipFile); + while(myZipHandler->hasNext()) + if(BSPF::startsWithIgnoreCase(myZipHandler->next(), _virtualPath)) + return true; + } + + return false; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool FilesystemNodeZIP::getChildren(AbstractFSList& myList, ListMode mode) const { diff --git a/src/common/FSNodeZIP.hxx b/src/common/FSNodeZIP.hxx index de8904315..079d3c546 100644 --- a/src/common/FSNodeZIP.hxx +++ b/src/common/FSNodeZIP.hxx @@ -42,7 +42,7 @@ class FilesystemNodeZIP : public AbstractFSNode */ explicit FilesystemNodeZIP(const string& path); - bool exists() const override { return _realNode && _realNode->exists(); } + bool exists() const override; const string& getName() const override { return _name; } void setName(const string& name) override { _name = name; } const string& getPath() const override { return _path; } diff --git a/src/emucore/PropsSet.cxx b/src/emucore/PropsSet.cxx index 65bae06bd..db6cfc1fe 100644 --- a/src/emucore/PropsSet.cxx +++ b/src/emucore/PropsSet.cxx @@ -184,7 +184,6 @@ void PropertiesSet::loadPerROM(const FilesystemNode& rom, const string& md5) // First, does this ROM have a per-ROM properties entry? // If so, load it into the database FilesystemNode propsNode(rom.getPathWithExt(".pro")); - if(propsNode.exists()) load(propsNode, false);