#define CTRL(x) ((x) ^ 0x40)
/* check if the char x is a char with CTRL like ^C */
-#define IS_CTRL(x) (((unsigned char)x) <= 32)
+#define IS_CTRL(x) (((unsigned char)x) <= 0x1f)
#define CSI 0x9b /* Control Sequence Introducer */
#define CSI_STR "\233"
/* if we get a keylen > 1 this means we have a better match for a previous
* ambiguous key sequence and have to remove the previous one before */
- if (!keylen || keylen > 1) {
+ if (keylen != 1) {
map.showbuf[0] = '\0';
}
/* show the most significant last chars in the statusbar if they don't
map.transchar[2] = '\0';
} else if ((c & 0xff) == CSI) {
map.transchar[0] = '~';
+ map.transchar[1] = '\0';
} else {
map.transchar[0] = c;
map.transchar[1] = '\0';