git: 9front

Download patch

ref: 218a172153e7a274fe80c495abd91bdf5e8ea5fb
parent: 38069ba8ca07e0dcf896071a1dc3fcea0d54b809
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Fri Nov 4 13:41:18 EDT 2022

bar: increase the buffer to fit more aux data (noam decided to display the currently playing track there)

--- a/sys/src/cmd/bar.c
+++ b/sys/src/cmd/bar.c
@@ -125,8 +125,7 @@
 static void
 redraw(void)
 {
-	static char s[128];
-	char tmp[128];
+	char s[1024];
 	Rectangle r;
 	Tmfmt tf;
 	Point p;
@@ -161,10 +160,10 @@
 
 	flushimage(display, 1);
 
-	snprint(tmp, sizeof(tmp), "%τ", tf);
-	twidth = MAX(twidth, stringwidth(f, tmp));
-	snprint(tmp, sizeof(tmp), "%|%s%|%s", bats, bats[0] ? "100%" : "", aux, aux);
-	width = twidth + stringwidth(f, tmp);
+	snprint(s, sizeof(s), "%τ", tf);
+	twidth = MAX(twidth, stringwidth(f, s));
+	snprint(s, sizeof(s), "%|%s%|%s", bats, bats[0] ? "100%" : "", aux, aux);
+	width = twidth + stringwidth(f, s);
 	if(owidth != width)
 		place();
 }
--