Fixed XMLReader system path processing.

getHomePath() now uses forward slash as a path separator on all platforms.
This commit is contained in:
Aloshi 2013-06-14 10:16:16 -05:00
parent aec15ba0a1
commit bf84945010
2 changed files with 10 additions and 8 deletions

View file

@ -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, "/");

View file

@ -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