1
0
forked from pool/console-setup
console-setup/0001-ckbcomp-Fix-check-for-non-ascii.patch
2022-12-20 15:34:06 +00:00

35 lines
1.1 KiB
Diff

From c73920250a124b9c6a73ed7211af74df993d449b Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.de>
Date: Mon, 12 Dec 2022 09:54:11 +0100
Subject: [PATCH] ckbcomp: Fix check for non-ascii
It did a string comparision with "127" (0x7f converted to string) which is
true also for characters below 100, like '1' (51) or 'Q' (81) because the
first letter of the string representation of their ASCII value is > '1'.
This bug meant that even maps which didn't need it had $broken_caps = 1,
leading to Caps_Lock getting replaced by CtrlL_Lock. With this patch, maps
like 'us' use Caps_Lock again.
Signed-off-by: Fabian Vogt <fvogt@suse.de>
---
Keyboard/ckbcomp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Keyboard/ckbcomp b/Keyboard/ckbcomp
index adbcd79..6108fff 100755
--- a/Keyboard/ckbcomp
+++ b/Keyboard/ckbcomp
@@ -4376,7 +4376,7 @@ sub print_vector {
my $u = ord (uc (pack ("U", $v)));
my $c = ($v == $l ? $u : $l);
$capsvector[$mask] = $1 ."U+". sprintf ("%04x", $c);
- if ($v != $c && $v gt 0x7f) {
+ if ($v != $c && $v > 0x7f) {
$broken_caps = 1;
}
}
--
2.38.1