diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2021-07-16 12:31:23 +0200 |
---|---|---|
committer | Szabolcs David <davidsz@inf.u-szeged.hu> | 2021-07-20 17:56:46 +0200 |
commit | 77c7d56531966ff444ebf9bab52f01da9bb4be21 (patch) | |
tree | 25cd714ec0c0ce4ce96c8dcb3361d28268d9251d /src/core/ozone | |
parent | 9c663f51c63f7661edcc604ce89171b3f037543d (diff) |
Fix assertion in getCurrentKeyboardLayout()
FATAL:xkb_keyboard_layout_engine.cc(640)] Keymap file failed to load: hu-us
If there are multiple layouts provided (eg. "hu,us") and there is no
layout variant, we appended the second layout as a variant (eg. "hu-us").
This happens because strtok() caches the pointer of the next token from
its previous call and uses that when processing a null string.
Pick-to: 6.2
Change-Id: Ic1d8bd14f95bda65a9fba82c1df45af306c4445b
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/ozone')
-rw-r--r-- | src/core/ozone/ozone_platform_qt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp index 7e2dc4edc..5b42acd9f 100644 --- a/src/core/ozone/ozone_platform_qt.cpp +++ b/src/core/ozone/ozone_platform_qt.cpp @@ -175,6 +175,9 @@ static std::string getCurrentKeyboardLayout() return std::string(); } + if (!vdr.variant) + return layout; + char *variant = strtok(vdr.variant, ","); if (!variant) return layout; |