From fbbc3cf8b8b03f74f778772d4703fc4fec242282 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 26 Jan 2022 16:55:50 +0100 Subject: [PATCH] XKBCvt: remove an if that never gets triggered The 'if' at the beginning of _XkbHandleSpecialSym() allows only symbols from the numeric keypad and some control symbols to pass -- XK_hyphen is not among them, so the check for XK_hyphen in the later 'if' will always be false. (The corresponding conversion in _XTranslateKeySym() in KeyBind.c was removed in March 1994.) (Also, several keyboard layouts nowadays contain the 'hyphen' symbol, allowing the user to enter soft hyphens into a document. So we really don't want to remap this symbol.) Fixes issue #48. Reported-by: Bhavi Dhingra Signed-off-by: Benno Schulenberg --- src/xkb/XKBCvt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/xkb/XKBCvt.c b/src/xkb/XKBCvt.c index 5317a0a5..77d09a3d 100644 --- a/src/xkb/XKBCvt.c +++ b/src/xkb/XKBCvt.c @@ -75,8 +75,6 @@ _XkbHandleSpecialSym(KeySym keysym, char *buffer, int nbytes, int *extra_rtrn) /* if X keysym, convert to ascii by grabbing low 7 bits */ if (keysym == XK_KP_Space) buffer[0] = XK_space & 0x7F; /* patch encoding botch */ - else if (keysym == XK_hyphen) - buffer[0] = (char) (XK_minus & 0xFF); /* map to equiv character */ else buffer[0] = (char) (keysym & 0x7F); return 1;