mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
terminal: decode_terminal_escape_sequence ignores previous value of *ev.
There is no need to check whether ev->ev == EVENT_KBD; if decode_terminal_escape_sequence called decode_terminal_mouse_escape_sequence, then the former neither modified kbd.key nor passed &kbd to the latter, so kbd.key remains KBD_UNDEF. If ev->ev was not checked, then it should not be trusted either. So reinitialize the whole *ev if a keyboard event was indeed found.
This commit is contained in:
parent
9e30ee631c
commit
51bc99a175
@ -770,10 +770,9 @@ decode_terminal_escape_sequence(struct itrm *itrm, struct term_event *ev)
|
||||
break;
|
||||
}
|
||||
|
||||
/* The event might have been changed to a mouse event */
|
||||
if (ev->ev == EVENT_KBD && kbd.key != KBD_UNDEF) {
|
||||
copy_struct(&ev->info.keyboard, &kbd);
|
||||
}
|
||||
/* KBD_UNDEF here means it was unrecognized or a mouse event. */
|
||||
if (kbd.key != KBD_UNDEF)
|
||||
set_kbd_term_event(ev, kbd.key, kbd.modifier);
|
||||
|
||||
return el;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user