mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-24 01:46:36 +02:00
don't call mapArgs from GetDataDir because it's not initialized yet
This commit is contained in:
parent
5dfe19c6ed
commit
695f1949eb
1 changed files with 5 additions and 5 deletions
10
util.cpp
10
util.cpp
|
@ -99,11 +99,12 @@ namespace filesystem
|
||||||
{
|
{
|
||||||
static boost::filesystem::path path;
|
static boost::filesystem::path path;
|
||||||
|
|
||||||
if (i2p::util::config::mapArgs.count("-datadir")) {
|
// TODO: datadir parameter is useless because GetDataDir is called before OptionParser
|
||||||
|
// and mapArgs is not initialized yet
|
||||||
|
/*if (i2p::util::config::mapArgs.count("-datadir"))
|
||||||
path = boost::filesystem::system_complete(i2p::util::config::mapArgs["-datadir"]);
|
path = boost::filesystem::system_complete(i2p::util::config::mapArgs["-datadir"]);
|
||||||
} else {
|
else */
|
||||||
path = GetDefaultDataDir();
|
path = GetDefaultDataDir();
|
||||||
}
|
|
||||||
|
|
||||||
if (!boost::filesystem::exists( path ))
|
if (!boost::filesystem::exists( path ))
|
||||||
{
|
{
|
||||||
|
@ -115,9 +116,8 @@ namespace filesystem
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!boost::filesystem::is_directory(path)) {
|
if (!boost::filesystem::is_directory(path))
|
||||||
path = GetDefaultDataDir();
|
path = GetDefaultDataDir();
|
||||||
}
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue