parse_keystroke: Never write back to the input string.
commitaba0bc77a85bc5a13c648b0bb2adbe2e32c2f1f3
authorKalle Olavi Niemitalo <kon@iki.fi>
Sun, 13 Aug 2006 11:24:28 +0000 (13 14:24 +0300)
committerKalle Olavi Niemitalo <Kalle@Astalo.kon.iki.fi>
Sun, 13 Aug 2006 11:24:28 +0000 (13 14:24 +0300)
treeb7d372b07f85b1b9416dcb45425399acd5a03d73
parent93ef5e02f56768a296fdf46400a8ab181a1a6a1f
parse_keystroke: Never write back to the input string.

This fixes a bug: in the previous version, l_bind_key() modified the
buffer whose address lua_tostring() returned, even though that is not
allowed according to Lua documentation <http://www.lua.org/pil/24.2.2.html>.

The change affects the user interface: previously, if the user typed
"ctrl+cokebottle" in the "Add keybinding" dialog box, ELinks would
change the text in the widget to "Ctrl-cokebottle" before complaining
that the keystroke is invalid.  Now, it leaves the widget unchanged.

This commit does not yet add const to parameters of parse_keystroke()
and related functions.
src/config/kbdbind.c