From 8cef417ee18ed5bf5f22da2f912afbb5c7eb4d6a Mon Sep 17 00:00:00 2001 From: "Peter D. Barnes, Jr" Date: Tue, 25 Oct 2022 00:30:40 -0700 Subject: [PATCH] core: (fixes #782) command-line: fix GetDefault --- src/core/model/command-line.cc | 11 +++++++---- src/core/model/command-line.h | 18 ++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/core/model/command-line.cc b/src/core/model/command-line.cc index 024e37d1d..f70386523 100644 --- a/src/core/model/command-line.cc +++ b/src/core/model/command-line.cc @@ -849,10 +849,13 @@ CommandLine::StringItem::GetDefault() const template <> std::string -CommandLineHelper::GetDefault(const bool& val) +CommandLineHelper::GetDefault(const std::string& defaultValue) { + bool value; + std::istringstream iss(defaultValue); + iss >> value; std::ostringstream oss; - oss << std::boolalpha << val; + oss << std::boolalpha << value; return oss.str(); } @@ -892,10 +895,10 @@ CommandLineHelper::UserItemParse(const std::string& value, bool& dest) template <> std::string -CommandLineHelper::GetDefault