Skip to content

Commit

Permalink
decode (ble/builtin/bind): fix a bug that only lowercase is accepted …
Browse files Browse the repository at this point in the history
…for deprecated keyname
  • Loading branch information
akinomyoga committed Jun 27, 2022
1 parent 3819e83 commit 43cf9b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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=
if [[ $1 == *-* ]]; then
ble/string#tolower "$1"
ble/string#split ret - "$ret"
ble/string#tolower "$1"; local value=$ret
if [[ $value == *-* ]]; then
ble/string#split ret - "$value"
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 value=${1##*-} ch=
case $value in
local name=${value##*-} 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 "$value" 0 1; ch=$ret ;;
(*) ble/util/substr "$name" 0 1; ch=$ret ;;
esac
ble/util/s2c "$ch"; local key=$ret

Expand Down

0 comments on commit 43cf9b9

Please sign in to comment.