shithub: fontsel

Download patch

ref: e8191594a857420fec9ea9585b3d4822a2dc4676
parent: 1648e4b043fa2f2e2ab0f0baeb6492b3acc58922
author: Sigrid Haflínudóttir <[email protected]>
date: Fri May 29 12:33:10 EDT 2020

don't fail if a fontdir is not available

--- a/fontsel.c
+++ b/fontsel.c
@@ -164,10 +164,14 @@
 	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)
-		sysfatal("no fonts");
+	if((f = open(t, OREAD)) < 0){
+		fprint(2, "font dir: %r\n");
+		return;
+	}
+	if((n = dirreadall(f, &d)) < 1){
+		fprint(2, "%s: no fonts\n", t);
+		return;
+	}
 	for(i = 0; i < n; i++){
 		sprint(t+doff, d[i].name);
 		if((fin = open(t, OREAD)) < 0)