[11216] Fixed crash at explictly empty string setting for dataDir in mangosd.conf.

This commit is contained in:
VladimirMangos 2011-03-03 22:06:11 +03:00
parent 06fe777f82
commit 5a3f557b19
2 changed files with 12 additions and 7 deletions

View file

@ -840,7 +840,12 @@ void World::LoadConfigSettings(bool reload)
///- Read the "Data" directory from the config file
std::string dataPath = sConfig.GetStringDefault("DataDir", "./");
if( dataPath.at(dataPath.length()-1)!='/' && dataPath.at(dataPath.length()-1)!='\\' )
// for empty string use current dir as for absent case
if (dataPath.empty())
dataPath = "./";
// normalize dir path to path/ or path\ form
else if (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\')
dataPath.append("/");
if (reload)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11215"
#define REVISION_NR "11216"
#endif // __REVISION_NR_H__