summaryrefslogtreecommitdiffhomepage
path: root/opentrack
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-01-11 18:29:02 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-01-11 18:29:02 +0100
commitc6cdf9cfc701b5c9f02f37178b8364abd0bf4d93 (patch)
treed2745e5dd6e0be8cfb039cf8e2fd0390b5245fd7 /opentrack
parent248677c03ff5c52bc90fcc3ce81e2ba9f592653b (diff)
opentrack: getenv value parsing woes
Diffstat (limited to 'opentrack')
-rw-r--r--opentrack/main-window.cpp8
1 files changed, 4 insertions, 4 deletions
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};