Skip to content

Commit

Permalink
s390/3270: fix garbled output on 3270 tty view
Browse files Browse the repository at this point in the history
The tty3270_update function tries to optimize the output stream by
skipping the TO_SBA command to position the output offset if the
TO_RA command of the previous line ended at the same offset.
But some lines do not have the TO_RA at the end, namely those
with a length equal to the number of columns.

Make sure there is a TO_RA at the end of the previous line to avoid
funny looking output.

Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
Martin Schwidefsky committed May 4, 2016
1 parent b512353 commit 2e63a3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/s390/char/tty3270.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ tty3270_update(struct tty3270 *tp)
if (raw3270_request_add_data(wrq, str, len) != 0)
break;
list_del_init(&s->update);
sba = s->string + s->len - 3;
if (s->string[s->len - 4] == TO_RA)
sba = s->string + s->len - 3;
else
sba = invalid_sba;
}
if (list_empty(&tp->update))
updated |= TTY_UPDATE_LIST;
Expand Down

0 comments on commit 2e63a3a

Please sign in to comment.