aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-04-22 14:56:03 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2012-04-22 14:56:03 -0700
commitef758662c595ca866ca7abe320452d785373314b (patch)
treeda3a6e5adc51ba5b1607b48ea22dc10b87ceef75 /src/util.cpp
parent457661f6400030f5979564462e8c625840cc5e58 (diff)
parentf4203de3021ca67f065d163b332e9814aee842d8 (diff)
Merge pull request #1133 from sipa/abspath
Make GetDataDir return absolute paths
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 9f2de3449d..7322b1e228 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -870,7 +870,11 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
LOCK(csPathCached);
if (mapArgs.count("-datadir")) {
- path = mapArgs["-datadir"];
+ path = fs::system_complete(mapArgs["-datadir"]);
+ if (!fs::is_directory(path)) {
+ path = "";
+ return path;
+ }
} else {
path = GetDefaultDataDir();
}
@@ -892,7 +896,7 @@ boost::filesystem::path GetConfigFile()
return pathConfigFile;
}
-bool ReadConfigFile(map<string, string>& mapSettingsRet,
+void ReadConfigFile(map<string, string>& mapSettingsRet,
map<string, vector<string> >& mapMultiSettingsRet)
{
namespace fs = boost::filesystem;
@@ -900,7 +904,7 @@ bool ReadConfigFile(map<string, string>& mapSettingsRet,
fs::ifstream streamConfig(GetConfigFile());
if (!streamConfig.good())
- return true; // No bitcoin.conf file is OK
+ return; // No bitcoin.conf file is OK
set<string> setOptions;
setOptions.insert("*");
@@ -917,7 +921,6 @@ bool ReadConfigFile(map<string, string>& mapSettingsRet,
}
mapMultiSettingsRet[strKey].push_back(it->value[0]);
}
- return true;
}
boost::filesystem::path GetPidFile()