From 02496da4d29eaa952273b922c8f4f719034a4894 Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Sun, 15 Dec 2019 03:08:06 -0600 Subject: [PATCH] Logic error --- simgear/structure/SGExpression.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/simgear/structure/SGExpression.cxx b/simgear/structure/SGExpression.cxx index e6b38500..4e2a4f83 100644 --- a/simgear/structure/SGExpression.cxx +++ b/simgear/structure/SGExpression.cxx @@ -95,9 +95,11 @@ SGReadValueFromString(const char* str, bool& value) SG_LOG(SG_IO, SG_ALERT, "Cannot read string content."); return false; } + std::stringstream s; s.str(std::string(str)); s >> value; + if (!s.fail()) return true; @@ -109,10 +111,12 @@ SGReadValueFromString(const char* str, bool& value) value = true; return true; } + if (stdstr == "false" || stdstr == "False" || stdstr == "FALSE") { - value = true; + value = false; return true; } + return false; }