From: kettenis Date: Sat, 22 Sep 2018 17:40:57 +0000 (+0000) Subject: Only clear the character backing store when the RI_CLEAR flag is set. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=03c8b0ac2f7aef649efec39dca24f98fab5770e8;p=openbsd Only clear the character backing store when the RI_CLEAR flag is set. ok deraadt@ --- 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; + } } }