return para_strdup(default_keyseqs[get_internal_key_map_idx(key)]);
}
-static char *get_user_key_map_seq(int key)
+static char *get_key_map_seq(int key)
{
- const char *kma = get_user_key_map_arg(key);
- const char *p = strchr(kma + 1, ':');
+ const char *kma, *p;
char *result;
int len;
- assert(p);
+ if (is_internal_key(key))
+ return get_internal_key_map_seq(key);
+ kma = get_user_key_map_arg(key);
+ p = strchr(kma + 1, ':');
+ assert(p); /* We checked earlier that kma contains a colon */
len = p - kma;
result = alloc(len + 1);
memcpy(result, kma, len);
return result;
}
-static char *get_key_map_seq(int key)
-{
- return is_internal_key(key)?
- get_internal_key_map_seq(key) : get_user_key_map_seq(key);
-}
-
static char *get_key_map_seq_safe(int key)
{
const char hex[] = "0123456789abcdef";