ULTIMA8: Avoid trying to make empty path name

This has no impact on most platforms, but it breaks Android.
This commit is contained in:
Matthew Duggan 2020-10-20 21:34:50 +09:00
parent 8bdb40a69c
commit 3eb363ed7f

View file

@ -220,7 +220,7 @@ bool FileSystem::AddVirtualPath(const string &vpath, const string &realpath, con
#ifdef DEBUG
debugN(MM_INFO, "virtual path \"%s\": %s\n", vp.c_str(), fullpath.c_str());
#endif
if (!(fullpath.substr(0, 8) == "@memory/")) {
if (!(fullpath.substr(0, 8) == "@memory/") && rp.length()) {
if (!IsDir(fullpath)) {
if (!create) {
#ifdef DEBUG
@ -271,7 +271,7 @@ bool FileSystem::rewrite_virtual_path(string &vfn) const {
string::size_type pos = vfn.size();
while ((pos = vfn.rfind('/', pos)) != Std::string::npos) {
// perr << vfn << ", " << vfn.substr(0, pos) << ", " << pos << Std::endl;
// perr << vfn << ", '" << vfn.substr(0, pos) << "', " << pos << Std::endl;
Std::map<Common::String, string>::const_iterator p = _virtualPaths.find(
vfn.substr(0, pos));