git: 9front

Download patch

ref: 3f32c7454d4b56287765892294281f53cbb72bdb
parent: cd46741b5c0b0674ce3db372bcc525daafcbfc46
author: Alex Musolino <alex@musolino.id.au>
date: Fri Jun 4 21:21:55 EDT 2021

upas/Mail: fix bug where Redraw must be executed twice to have an effect

In showlist, call bwindata instead of bwinopen in order to use a
pre-existing fd to write to the data file.  This existing fd will
properly honour any address set by a previous write to the addr file.
Specifically, the redraw function sets addr to "," before calling
showlist in order to overwrite the entire contents of the window.

--- a/sys/src/cmd/upas/Mail/mbox.c
+++ b/sys/src/cmd/upas/Mail/mbox.c
@@ -746,7 +746,7 @@
 	Mesg *m;
 	int i;
 
-	bfd = bwinopen(&mbox, "data", OWRITE);
+	bfd = bwindata(&mbox, OWRITE);
 	for(i = 0; i < mbox.nmesg; i++){
 		m = mbox.mesg[i];
 		if(mbox.view == Vflat || m->state & (Sdummy|Stoplev))
--