aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r--src/util/system.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index 82770dc665..7bf1e8b8e5 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -440,9 +440,9 @@ const fs::path& ArgsManager::GetDataDir(bool net_specific) const
// this function
if (!path.empty()) return path;
- std::string datadir = GetArg("-datadir", "");
+ const fs::path datadir{GetPathArg("-datadir")};
if (!datadir.empty()) {
- path = fs::absolute(StripRedundantLastElementsOfPath(fs::PathFromString(datadir)));
+ path = fs::absolute(datadir);
if (!fs::is_directory(path)) {
path = "";
return path;
@@ -823,8 +823,8 @@ fs::path GetDefaultDataDir()
bool CheckDataDirOption()
{
- std::string datadir = gArgs.GetArg("-datadir", "");
- return datadir.empty() || fs::is_directory(fs::absolute(fs::PathFromString(datadir)));
+ const fs::path datadir{gArgs.GetPathArg("-datadir")};
+ return datadir.empty() || fs::is_directory(fs::absolute(datadir));
}
fs::path GetConfigFile(const std::string& confPath)