diff --git a/desmume/src/path.h b/desmume/src/path.h index 3004aefb7..a5b7f6489 100644 --- a/desmume/src/path.h +++ b/desmume/src/path.h @@ -269,11 +269,17 @@ public: std::string temp = pathToCopy; int len = (int)temp.size()-1; #ifdef WIN32 - if(temp[len] != '\\') - temp += "\\"; + if(len == -1) + temp = ".\\"; + else + if(temp[len] != '\\') + temp += "\\"; #else - if(temp[len] != '/') - temp += "/"; + if(len == -1) + temp = "./"; + else + if(temp[len] != '/') + temp += "/"; #endif if(!Path::IsPathRooted(temp))