From 695f1949eb6abe32ce79cb38dfec6b2e89bf9fcc Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 12 Mar 2014 07:21:58 -0400 Subject: [PATCH] don't call mapArgs from GetDataDir because it's not initialized yet --- util.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util.cpp b/util.cpp index 1917a984..262b6e25 100644 --- a/util.cpp +++ b/util.cpp @@ -99,11 +99,12 @@ namespace filesystem { 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"]); - } else { + else */ path = GetDefaultDataDir(); - } if (!boost::filesystem::exists( path )) { @@ -115,9 +116,8 @@ namespace filesystem return path; } } - if (!boost::filesystem::is_directory(path)) { + if (!boost::filesystem::is_directory(path)) path = GetDefaultDataDir(); - } return path; }