mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
args: Catch directories in place of config files
Previously passing a directory path as -conf would lead to an ifstream being opened for it, and would not trigger any errors.
This commit is contained in:
@@ -125,6 +125,8 @@ bool StartLogging(const ArgsManager& args)
|
||||
fs::path config_file_path = args.GetConfigFilePath();
|
||||
if (args.IsArgNegated("-conf")) {
|
||||
LogInfo("Config file: <disabled>");
|
||||
} else if (fs::is_directory(config_file_path)) {
|
||||
LogWarning("Config file: %s (is directory, not file)", fs::PathToString(config_file_path));
|
||||
} else if (fs::exists(config_file_path)) {
|
||||
LogPrintf("Config file: %s\n", fs::PathToString(config_file_path));
|
||||
} else if (args.IsArgSet("-conf")) {
|
||||
|
||||
Reference in New Issue
Block a user