]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[console] Restore compatibility with "--key" values in existing scripts 990/head
authorMichael Brown <mcb30@ipxe.org>
Fri, 7 Jul 2023 14:05:39 +0000 (15:05 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 7 Jul 2023 14:14:00 +0000 (15:14 +0100)
commitc30b71ee9cc2dc2a1d2f225d99f2d70dd73de247
tree57e80a0b4079fdcacfbc1b2082219ed0dafb3a28
parentf3036fc213b6e6cce0bf5572167b93b9e9959a3a
[console] Restore compatibility with "--key" values in existing scripts

Commit 3ef4f7e ("[console] Avoid overlap between special keys and
Unicode characters") renumbered the special key encoding to avoid
collisions with Unicode key values outside the ASCII range.  This
change broke backwards compatibility with existing scripts that
specify key values using e.g. "prompt --key" or "menu --key".

Restore compatibility with existing scripts by tweaking the special
key encoding so that the relative key value (i.e. the delta from
KEY_MIN) is numerically equal to the old pre-Unicode key value, and by
modifying parse_key() to accept a relative key value.

Reported-by: Sven Dreyer <sven@dreyer-net.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/parseopt.c
src/include/ctype.h
src/include/ipxe/keys.h