Skip to content

Commit 99b8659

Browse files
MarcoFalkeapoelstra
authored andcommitted
Fix crash when parsing command line with -noincludeconf=0
1 parent c98902b commit 99b8659

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/util/system.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ bool ArgsManager::ParseParameters(int argc, const char* const argv[], std::strin
328328
bool success = true;
329329
if (auto* includes = util::FindKey(m_settings.command_line_options, "includeconf")) {
330330
for (const auto& include : util::SettingsSpan(*includes)) {
331-
error += "-includeconf cannot be used from commandline; -includeconf=" + include.get_str() + "\n";
331+
error += "-includeconf cannot be used from commandline; -includeconf=" + include.write() + "\n";
332332
success = false;
333333
}
334334
}

test/functional/feature_includeconf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ def run_test(self):
4343

4444
self.log.info("-includeconf cannot be used as command-line arg")
4545
self.stop_node(0)
46-
self.nodes[0].assert_start_raises_init_error(extra_args=["-includeconf=relative2.conf"], expected_msg="Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf=relative2.conf")
46+
self.nodes[0].assert_start_raises_init_error(
47+
extra_args=['-noincludeconf=0'],
48+
expected_msg='Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf=true',
49+
)
50+
self.nodes[0].assert_start_raises_init_error(
51+
extra_args=['-includeconf=relative2.conf'],
52+
expected_msg='Error: Error parsing command line arguments: -includeconf cannot be used from commandline; -includeconf="relative2.conf"',
53+
)
4754

4855
self.log.info("-includeconf cannot be used recursively. subversion should end with 'main; relative)/'")
4956
with open(os.path.join(self.options.tmpdir, "node0", "relative.conf"), "a", encoding="utf8") as f:

0 commit comments

Comments
 (0)