aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2016-04-28 10:32:13 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-05-04 10:29:52 -0400
commit2e63a3a66655d5fe5d85c090b009979870436c00 (patch)
treeb371c5960714a2f4888a884e17eb5ab113f9d76e
parentb512353c15fe7665893e92e0c989c088505a37b8 (diff)
s390/3270: fix garbled output on 3270 tty view
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 <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/char/tty3270.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index e8afa07f082e..54ea5a01e30d 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -405,7 +405,10 @@ tty3270_update(struct tty3270 *tp)
405 if (raw3270_request_add_data(wrq, str, len) != 0) 405 if (raw3270_request_add_data(wrq, str, len) != 0)
406 break; 406 break;
407 list_del_init(&s->update); 407 list_del_init(&s->update);
408 sba = s->string + s->len - 3; 408 if (s->string[s->len - 4] == TO_RA)
409 sba = s->string + s->len - 3;
410 else
411 sba = invalid_sba;
409 } 412 }
410 if (list_empty(&tp->update)) 413 if (list_empty(&tp->update))
411 updated |= TTY_UPDATE_LIST; 414 updated |= TTY_UPDATE_LIST;