Make path separator OS-dependent (PR #954)

This commit is contained in:
Andrea
2021-05-19 21:10:22 +01:00
committed by GitHub
parent 1b9a769332
commit de7f35e6bd
10 changed files with 30 additions and 24 deletions
+2 -2
View File
@@ -321,7 +321,7 @@ static std::string GetFullPath(LPCSTR szFileName)
{
std::string strPathName;
if (szFileName[0] == '\\' || szFileName[1] == ':')
if (szFileName[0] == PATH_SEPARATOR || szFileName[1] == ':')
{
// Abs pathname
strPathName = szFileName;
@@ -344,7 +344,7 @@ static void SetCurrentDir(std::string pathname)
// . if -[sN]d1 and -[sN]d2 are specified, then g_sCurrentDir will be set to the d2 image's path
// This is purely dependent on the current order of InsertFloppyDisks() & InsertHardDisks() - ie. very brittle!
// . better to use -current-dir to be explicit
std::size_t found = pathname.find_last_of("\\");
std::size_t found = pathname.find_last_of(PATH_SEPARATOR);
std::string path = pathname.substr(0, found);
SetCurrentImageDir(path);
}