shithub: fontsel

Download patch

ref: b19456783bfc59892e39eed33b16a31726ab0a28
parent: 8dff7b6ee540e18d4cc50e69c1775b2eaf28ca01
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Apr 14 09:14:49 EDT 2020

fix label and extra slash char

--- a/fontsel.c
+++ b/fontsel.c
@@ -38,7 +38,7 @@
 	"}",
 };
 
-static char *prefix = "/lib/font/bit/";
+static char *prefix = "/lib/font/bit";
 static Font *f;
 static Fontdir *dirs, *cdir;
 static int ndirs, idir;
@@ -137,6 +137,8 @@
 	char t[1024];
 
 	doff = sprint(t, prefix);
+	t[doff++] = '/';
+	t[doff] = 0;
 	if((f = open(t, OREAD)) < 0)
 		sysfatal("font dir: %r");
 	if((n = dirreadall(f, &d)) < 1)
@@ -207,7 +209,7 @@
 	if(ndirs < 1)
 		sysfatal("no fonts");
 
-	if(initdraw(nil, nil, "picker") < 0)
+	if(initdraw(nil, nil, "fontsel") < 0)
 		sysfatal("initdraw: %r");
 	if((kctl = initkeyboard(nil)) == nil)
 		sysfatal("initkeyboard: %r");