Sync HPA and VPA implementations with CUP.
After fixing the 16-bits integer arithmetic overflow in 286981, we should also make sure to fix the VPA sequence. Bring HPA and VPA in sync with how we now implement CUP. PR: 202612 Reported by: kcwu csie org MFC after: 1 month
This commit is contained in:
parent
ad4e7c1533
commit
0d7a21a4bd
@ -583,9 +583,9 @@ static void
|
||||
teken_subr_horizontal_position_absolute(teken_t *t, unsigned int col)
|
||||
{
|
||||
|
||||
t->t_cursor.tp_col = col - 1;
|
||||
if (t->t_cursor.tp_col >= t->t_winsize.tp_col)
|
||||
t->t_cursor.tp_col = t->t_winsize.tp_col - 1;
|
||||
col--;
|
||||
t->t_cursor.tp_col = col < t->t_winsize.tp_col ?
|
||||
col : t->t_winsize.tp_col - 1;
|
||||
|
||||
t->t_stateflags &= ~TS_WRAPPED;
|
||||
teken_funcs_cursor(t);
|
||||
@ -1297,9 +1297,9 @@ static void
|
||||
teken_subr_vertical_position_absolute(teken_t *t, unsigned int row)
|
||||
{
|
||||
|
||||
t->t_cursor.tp_row = t->t_originreg.ts_begin + row - 1;
|
||||
if (t->t_cursor.tp_row >= t->t_originreg.ts_end)
|
||||
t->t_cursor.tp_row = t->t_originreg.ts_end - 1;
|
||||
row = row - 1 + t->t_originreg.ts_begin;
|
||||
t->t_cursor.tp_row = row < t->t_originreg.ts_end ?
|
||||
row : t->t_originreg.ts_end - 1;
|
||||
|
||||
t->t_stateflags &= ~TS_WRAPPED;
|
||||
teken_funcs_cursor(t);
|
||||
|
Loading…
Reference in New Issue
Block a user