* Correctly resolve plain ASCII characters in codetoksym. The original
auto-conversion patch handles keysyms smaller than 0x80 incorrectly if
prefer_unicode is set.
* Avoid a memory leak in set_charset.
Signed-off-by: Michael Schutte <michi@uiae.at>
#include <linux/keyboard.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include "ksyms.h"
#include "nls.h"
/* Functions for both dumpkeys and loadkeys. */
int prefer_unicode = 0;
-static const char *chosen_charset = NULL;
+static char *chosen_charset = NULL;
void
list_charsets(FILE *f) {
if(p->name[0])
syms[0].table[i] = p->name;
}
+ if (chosen_charset)
+ free(chosen_charset);
chosen_charset = strdup(charset);
return 0;
}
return NULL;
if (code < 0x1000) { /* "traditional" keysym */
+ if (code < 0x80)
+ return iso646_syms[code];
if (KTYP(code) == KT_META)
return NULL;
if (KTYP(code) == KT_LETTER)