Skip to content

Commit

Permalink
decode (ble/builtin/bind): fix a bug that deprecated form of keyname …
Browse files Browse the repository at this point in the history
…is misinterpreted as lowercase
  • Loading branch information
akinomyoga committed Jun 27, 2022
1 parent 43cf9b9 commit dd358d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/decode.sh
Expand Up @@ -2495,9 +2495,9 @@ ble/function#suppress-stderr ble/builtin/bind/.decompose-pair
## @var[out] chars
function ble/builtin/bind/.parse-keyname {
local ret mflags=
ble/string#tolower "$1"; local value=$ret
if [[ $value == *-* ]]; then
ble/string#split ret - "$value"
ble/string#tolower "$1"; local lower=$ret
if [[ $1 == *-* ]]; then
ble/string#split ret - "$lower"
local mod
for mod in "${ret[@]::${#ret[@]}-1}"; do
case $mod in
Expand All @@ -2507,15 +2507,15 @@ function ble/builtin/bind/.parse-keyname {
done
fi

local name=${value##*-} ch=
local name=${lower##*-} ch=
case $name in
(rubout|del) ch=$'\177' ;;
(escape|esc) ch=$'\033' ;;
(newline|lfd) ch=$'\n' ;;
(return|ret) ch=$'\r' ;;
(space|spc) ch=' ' ;;
(tab) ch=$'\t' ;;
(*) ble/util/substr "$name" 0 1; ch=$ret ;;
(*) ble/util/substr "${1##*-}" 0 1; ch=$ret ;;
esac
ble/util/s2c "$ch"; local key=$ret

Expand Down

0 comments on commit dd358d7

Please sign in to comment.