Upper limit of mousechar start is UCHAR_MAX - 3, not UCHAR_MAX - 4
Restore original characters when mousechar start changes, not always 0-3 PR: 24437 Submitted by: Cejka Rudolf <cejkar@dcse.fee.vutbr.cz>
This commit is contained in:
parent
4d98b7a61b
commit
475693945d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75790
@ -876,13 +876,15 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
|
||||
if (mouse->u.mouse_char < 0) {
|
||||
mouse->u.mouse_char = scp->sc->mouse_char;
|
||||
} else {
|
||||
if (mouse->u.mouse_char >= UCHAR_MAX - 4)
|
||||
if (mouse->u.mouse_char > UCHAR_MAX - 3)
|
||||
return EINVAL;
|
||||
s = spltty();
|
||||
sc_remove_all_mouse(scp->sc);
|
||||
#ifndef SC_NO_FONT_LOADING
|
||||
if (ISTEXTSC(cur_scp) && (cur_scp->font != NULL))
|
||||
sc_load_font(cur_scp, 0, cur_scp->font_size, cur_scp->font,
|
||||
sc_load_font(cur_scp, 0, cur_scp->font_size,
|
||||
cur_scp->font + cur_scp->font_size
|
||||
* cur_scp->sc->mouse_char,
|
||||
cur_scp->sc->mouse_char, 4);
|
||||
#endif
|
||||
scp->sc->mouse_char = mouse->u.mouse_char;
|
||||
|
Loading…
Reference in New Issue
Block a user