aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.cpp
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2022-02-09 17:54:49 -0500
committerRyan Ofsky <ryan@ofsky.org>2022-03-02 06:09:27 -0500
commit5b946edd73640c6ecdfb4cbac1d4351e634678dc (patch)
treeddbb1bf8953b04eb356bd1af996e5dae6674153c /src/util/system.cpp
parent687e655ae2970f2f13aca0267c7de86dc69be763 (diff)
downloadbitcoin-5b946edd73640c6ecdfb4cbac1d4351e634678dc.tar.xz
util, refactor: Use GetPathArg to read "-settings" value
Take advantage of GetPathArg to simplify code slightly.
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r--src/util/system.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index af5a511a78..1ad701c56d 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -519,12 +519,12 @@ bool ArgsManager::InitSettings(std::string& error)
bool ArgsManager::GetSettingsPath(fs::path* filepath, bool temp) const
{
- if (IsArgNegated("-settings")) {
+ fs::path settings = GetPathArg("-settings", fs::path{BITCOIN_SETTINGS_FILENAME});
+ if (settings.empty()) {
return false;
}
if (filepath) {
- std::string settings = GetArg("-settings", BITCOIN_SETTINGS_FILENAME);
- *filepath = fsbridge::AbsPathJoin(GetDataDirNet(), fs::PathFromString(temp ? settings + ".tmp" : settings));
+ *filepath = fsbridge::AbsPathJoin(GetDataDirNet(), temp ? settings + ".tmp" : settings);
}
return true;
}