summaryrefslogtreecommitdiff
path: root/src/locale/keymap-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-05-29 22:02:57 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-06 09:22:33 -0400
commit03a44125b8af43df6ef8f4af63a8e48607de1a0d (patch)
tree43c06567441df26b60d0b8e07cdeebe9d891ea60 /src/locale/keymap-util.c
parent5ad327dda2b863697cf5cdc0b1724aed96c5397a (diff)
keymap-util: also "convert" 'ru' to 'ru'
As discovered by Adam Williamson in https://bugzilla.redhat.com/show_bug.cgi?id=1333998#c32, after the changes in 81fd105a5f9 we would only match compound layouts, i.e. a comma would be required after 'ru' to match. This seems wrong, and we should match single layouts like too. So 'ru', 'ru,us' now both match. startswith_comma is changed to not require a comma, i.e. check that the prefix matches until a comma or the end of the string. Note that startswith_comma is called twice. At the first site, we check that strings are not equal beforehand, so this change to startswith_comma has no effect. At the second site, it does have an effect, as described above.
Diffstat (limited to 'src/locale/keymap-util.c')
-rw-r--r--src/locale/keymap-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c
index fe29594ccc..17bef9e481 100644
--- a/src/locale/keymap-util.c
+++ b/src/locale/keymap-util.c
@@ -39,7 +39,7 @@ static bool startswith_comma(const char *s, const char *prefix) {
if (!s)
return false;
- return *s == ',';
+ return *s == ',' || *s == '\0';
}
static const char* strnulldash(const char *s) {