mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[11216] Fixed crash at explictly empty string setting for dataDir in mangosd.conf.
This commit is contained in:
parent
06fe777f82
commit
5a3f557b19
2 changed files with 12 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11215"
|
||||
#define REVISION_NR "11216"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue