mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
Fixed XMLReader system path processing.
getHomePath() now uses forward slash as a path separator on all platforms.
This commit is contained in:
parent
aec15ba0a1
commit
bf84945010
|
@ -33,14 +33,12 @@ GameData* createGameFromPath(std::string gameAbsPath, SystemData* system)
|
|||
std::string sysPath = system->getStartPath();
|
||||
|
||||
//strip out the system path stuff so it's relative to the system root folder
|
||||
for(unsigned int i = 0; i < gamePath.length(); i++)
|
||||
{
|
||||
if(gamePath[i] != sysPath[i])
|
||||
{
|
||||
gamePath = gamePath.substr(i, gamePath.length() - i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
unsigned int i = 0;
|
||||
while(i < gamePath.length() && i < sysPath.length() && gamePath[i] == sysPath[i])
|
||||
i++;
|
||||
|
||||
gamePath = gamePath.substr(i, gamePath.length() - i);
|
||||
|
||||
|
||||
if(gamePath[0] != '/')
|
||||
gamePath.insert(0, "/");
|
||||
|
|
|
@ -19,6 +19,10 @@ std::string getHomePath()
|
|||
if (envDir != nullptr && envPath != nullptr) {
|
||||
homePath = envDir;
|
||||
homePath += envPath;
|
||||
|
||||
for(unsigned int i = 0; i < homePath.length(); i++)
|
||||
if(homePath[i] == '\\')
|
||||
homePath[i] = '/';
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue