mirror of
https://github.com/lbonn/rofi
synced 2024-11-27 06:10:30 +00:00
Use g_strsplit_set instead of strtok so we can run g_strsplit in place
This commit is contained in:
parent
a259738720
commit
ea28bcdc74
1 changed files with 5 additions and 2 deletions
|
@ -648,8 +648,10 @@ gboolean x11_parse_key ( const char *combo, unsigned int *mod, xkb_keysym_t *key
|
|||
|
||||
char *saveptr = NULL;
|
||||
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 ) ) {
|
||||
|
||||
char **entries = g_strsplit_set ( mod_key, "+-", -1);
|
||||
for ( int i = 0; entries && entries[i]; i++ ) {
|
||||
char *entry = entries[i];
|
||||
// Remove trailing and leading spaces.
|
||||
entry = g_strstrip ( entry );
|
||||
// Compare against lowered version.
|
||||
|
@ -698,6 +700,7 @@ gboolean x11_parse_key ( const char *combo, unsigned int *mod, xkb_keysym_t *key
|
|||
}
|
||||
g_free ( entry_lowered );
|
||||
}
|
||||
g_strfreev(entries);
|
||||
|
||||
g_free ( input_key );
|
||||
|
||||
|
|
Loading…
Reference in a new issue