From 5b946edd73640c6ecdfb4cbac1d4351e634678dc Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Wed, 9 Feb 2022 17:54:49 -0500 Subject: [PATCH] util, refactor: Use GetPathArg to read "-settings" value Take advantage of GetPathArg to simplify code slightly. --- src/util/system.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/system.cpp b/src/util/system.cpp index af5a511a788..1ad701c56d9 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; }