aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/unittest/test_utilities.cpp2
-rw-r--r--src/util/string.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/unittest/test_utilities.cpp b/src/unittest/test_utilities.cpp
index d73975b9f..58412dd85 100644
--- a/src/unittest/test_utilities.cpp
+++ b/src/unittest/test_utilities.cpp
@@ -147,6 +147,8 @@ void TestUtilities::testIsYes()
UASSERT(is_yes("0") == false);
UASSERT(is_yes("1") == true);
UASSERT(is_yes("2") == true);
+ UASSERT(is_yes("on") == true);
+ UASSERT(is_yes("off") == false);
}
diff --git a/src/util/string.h b/src/util/string.h
index 572c37150..ba3c09e51 100644
--- a/src/util/string.h
+++ b/src/util/string.h
@@ -272,7 +272,7 @@ inline bool is_yes(const std::string &str)
{
std::string s2 = lowercase(trim(str));
- return s2 == "y" || s2 == "yes" || s2 == "true" || atoi(s2.c_str()) != 0;
+ return s2 == "y" || s2 == "yes" || s2 == "true" || s2 == "on" || atoi(s2.c_str()) != 0;
}