shithub: riscv

Download patch

ref: 886b0f70cdb8cf07af5b90bd1b6caeb91fe080df
parent: 0cc26776cece29a23d1ddbad750a534df8d29f1b
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();
 }