Skip to content

Commit b1a925f

Browse files
moinejfgregkh
authored andcommitted
tty vt: Fix a regression in command line edition
The commit 81732c3 ("Fix line garbage in virtual console on command line edition") made a regression with some machines: some characters were not erased after line edition. This patch adjusts the number of moved characters and the size of the region to be updated. Signed-off-by: Jean-François Moine <moinejf@free.fr> Tested-by: Krzysztof Mazur <krzysiek@podlesie.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f4a75d2 commit b1a925f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/tty/vt/vt.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -539,25 +539,25 @@ static void insert_char(struct vc_data *vc, unsigned int nr)
539539
{
540540
unsigned short *p = (unsigned short *) vc->vc_pos;
541541

542-
scr_memmovew(p + nr, p, vc->vc_cols - vc->vc_x);
542+
scr_memmovew(p + nr, p, (vc->vc_cols - vc->vc_x) * 2);
543543
scr_memsetw(p, vc->vc_video_erase_char, nr * 2);
544544
vc->vc_need_wrap = 0;
545545
if (DO_UPDATE(vc))
546546
do_update_region(vc, (unsigned long) p,
547-
(vc->vc_cols - vc->vc_x) / 2 + 1);
547+
vc->vc_cols - vc->vc_x);
548548
}
549549

550550
static void delete_char(struct vc_data *vc, unsigned int nr)
551551
{
552552
unsigned short *p = (unsigned short *) vc->vc_pos;
553553

554-
scr_memcpyw(p, p + nr, vc->vc_cols - vc->vc_x - nr);
554+
scr_memcpyw(p, p + nr, (vc->vc_cols - vc->vc_x - nr) * 2);
555555
scr_memsetw(p + vc->vc_cols - vc->vc_x - nr, vc->vc_video_erase_char,
556556
nr * 2);
557557
vc->vc_need_wrap = 0;
558558
if (DO_UPDATE(vc))
559559
do_update_region(vc, (unsigned long) p,
560-
(vc->vc_cols - vc->vc_x) / 2);
560+
vc->vc_cols - vc->vc_x);
561561
}
562562

563563
static int softcursor_original;

0 commit comments

Comments
 (0)