use lower()

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 2 years ago
parent 35b6780d02
commit 7f5430a7d4

@ -7,6 +7,7 @@
#include "futils.hpp" #include "futils.hpp"
#include "i18n.h" // for _exvGettext #include "i18n.h" // for _exvGettext
#include "safe_op.hpp" #include "safe_op.hpp"
#include "utils.hpp"
// + standard includes // + standard includes
#include <array> #include <array>
@ -513,10 +514,9 @@ const char* exvGettext(const char* str) {
template <> template <>
bool stringTo<bool>(const std::string& s, bool& ok) { bool stringTo<bool>(const std::string& s, bool& ok) {
std::string lcs(s); /* lowercase string */ if (s.empty())
for (size_t i = 0; i < lcs.length(); i++) { return false;
lcs[i] = std::tolower(s[i]); auto lcs = Internal::lower(s); /* lowercase string */
}
/* handle the same values as xmp sdk */ /* handle the same values as xmp sdk */
if (lcs == "false" || lcs == "f" || lcs == "0") { if (lcs == "false" || lcs == "f" || lcs == "0") {
ok = true; ok = true;

Loading…
Cancel
Save