summaryrefslogtreecommitdiffstats
path: root/source/x11-helper.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-12-06 19:30:53 +0100
committerDave Davenport <qball@gmpclient.org>2016-12-06 19:30:53 +0100
commit3e3fb24ea52c860f333675ab33b001bdb82c3b47 (patch)
treed671920d9b8f7a4efe869dd23b073acd28951b93 /source/x11-helper.c
parentc759f248b4c4609859538829f04d8481e9bda076 (diff)
Strip spaces from key-name (Issue: #511)
Diffstat (limited to 'source/x11-helper.c')
-rw-r--r--source/x11-helper.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/x11-helper.c b/source/x11-helper.c
index a9a79e4a..5061e347 100644
--- a/source/x11-helper.c
+++ b/source/x11-helper.c
@@ -650,6 +650,8 @@ gboolean x11_parse_key ( const char *combo, unsigned int *mod, xkb_keysym_t *key
xkb_keysym_t sym = XKB_KEY_NoSymbol;
for ( char *entry = strtok_r ( mod_key, "+-", &saveptr ); error_msg == NULL && entry != NULL;
entry = strtok_r ( NULL, "+-", &saveptr ) ) {
+ // Remove trailing and leading spaces.
+ entry = g_strstrip ( entry );
// Compare against lowered version.
char *entry_lowered = g_utf8_strdown ( entry, -1 );
if ( g_utf8_collate ( entry_lowered, "shift" ) == 0 ) {