From c6cdf9cfc701b5c9f02f37178b8364abd0bf4d93 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 11 Jan 2022 18:29:02 +0100 Subject: opentrack: getenv value parsing woes --- opentrack/main-window.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'opentrack/main-window.cpp') diff --git a/opentrack/main-window.cpp b/opentrack/main-window.cpp index 6ded7919..d7e00625 100644 --- a/opentrack/main-window.cpp +++ b/opentrack/main-window.cpp @@ -576,16 +576,16 @@ bool main_window::module_tabs_enabled() const if (!str || !*str) return tabs_maybe; constexpr const char* strings_for_false[] = { - "0", "-1", "no", "n", "disable", "disabled", "false", "f", + "0", "n", "f", "disable", }; constexpr const char* strings_for_true[] = { - "1", "yes", "y", "enable", "enabled", "true", "t", + "1", "y", "t", "enable", }; for (const auto* x : strings_for_false) - if (!strcasecmp(str, x)) + if (!strncasecmp(str, x, strlen(x))) return tabs_disable; for (const auto* x : strings_for_true) - if (!strcasecmp(str, x)) + if (!strncasecmp(str, x, strlen(x))) return tabs_enable; qDebug() << "main-window: invalid boolean for OPENTRACK_MODULE_TABS:" << QLatin1String{str}; -- cgit v1.2.3