From 03c8b0ac2f7aef649efec39dca24f98fab5770e8 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sat, 22 Sep 2018 17:40:57 +0000 Subject: [PATCH] Only clear the character backing store when the RI_CLEAR flag is set. ok deraadt@ --- sys/dev/rasops/rasops.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index ec2c7bac4ca..4c1e8d28031 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.56 2018/08/27 09:30:07 kettenis Exp $ */ +/* $OpenBSD: rasops.c,v 1.57 2018/09/22 17:40:57 kettenis Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -309,10 +309,12 @@ rasops_init(struct rasops_info *ri, int wantrows, int wantcols) ri->ri_ops.eraserows = rasops_wronly_eraserows; ri->ri_do_cursor = rasops_wronly_do_cursor; - ri->ri_alloc_attr(ri, 0, 0, 0, &attr); - for (i = 0; i < ri->ri_rows * ri->ri_cols; i++) { - ri->ri_bs[i].uc = ' '; - ri->ri_bs[i].attr = attr; + if (ri->ri_flg & RI_CLEAR) { + ri->ri_alloc_attr(ri, 0, 0, 0, &attr); + for (i = 0; i < ri->ri_rows * ri->ri_cols; i++) { + ri->ri_bs[i].uc = ' '; + ri->ri_bs[i].attr = attr; + } } } -- 2.20.1