Commit 3d5f5b97 authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman

tty: vt: use switch+case in the ESnonstd case

To be uniform in the 'c' handling, use switch-case (with ranges) even in
the ESnonstd case in do_con_trol().
Signed-off-by: default avatar"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20240202065608.14019-20-jirislaby@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 798d8b1c
...@@ -2573,16 +2573,18 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, u8 c) ...@@ -2573,16 +2573,18 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, u8 c)
handle_esc(tty, vc, c); handle_esc(tty, vc, c);
return; return;
case ESnonstd: /* ESC ] aka OSC */ case ESnonstd: /* ESC ] aka OSC */
if (c=='P') { /* palette escape sequence */ switch (c) {
case 'P': /* palette escape sequence */
vc_reset_params(vc); vc_reset_params(vc);
vc->vc_state = ESpalette; vc->vc_state = ESpalette;
return; return;
} else if (c=='R') { /* reset palette */ case 'R': /* reset palette */
reset_palette(vc); reset_palette(vc);
vc->vc_state = ESnormal; break;
} else if (c>='0' && c<='9') case '0' ... '9':
vc->vc_state = ESosc; vc->vc_state = ESosc;
else return;
}
vc->vc_state = ESnormal; vc->vc_state = ESnormal;
return; return;
case ESpalette: /* ESC ] P aka OSC P */ case ESpalette: /* ESC ] P aka OSC P */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment