mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +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();
|
std::string sysPath = system->getStartPath();
|
||||||
|
|
||||||
//strip out the system path stuff so it's relative to the system root folder
|
//strip out the system path stuff so it's relative to the system root folder
|
||||||
for(unsigned int i = 0; i < gamePath.length(); i++)
|
unsigned int i = 0;
|
||||||
{
|
while(i < gamePath.length() && i < sysPath.length() && gamePath[i] == sysPath[i])
|
||||||
if(gamePath[i] != sysPath[i])
|
i++;
|
||||||
{
|
|
||||||
gamePath = gamePath.substr(i, gamePath.length() - i);
|
gamePath = gamePath.substr(i, gamePath.length() - i);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(gamePath[0] != '/')
|
if(gamePath[0] != '/')
|
||||||
gamePath.insert(0, "/");
|
gamePath.insert(0, "/");
|
||||||
|
|
|
@ -19,6 +19,10 @@ std::string getHomePath()
|
||||||
if (envDir != nullptr && envPath != nullptr) {
|
if (envDir != nullptr && envPath != nullptr) {
|
||||||
homePath = envDir;
|
homePath = envDir;
|
||||||
homePath += envPath;
|
homePath += envPath;
|
||||||
|
|
||||||
|
for(unsigned int i = 0; i < homePath.length(); i++)
|
||||||
|
if(homePath[i] == '\\')
|
||||||
|
homePath[i] = '/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue