~ft/fontsel

e8191594a857420fec9ea9585b3d4822a2dc4676 — Sigrid Haflínudóttir 4 months ago 1648e4b
don't fail if a fontdir is not available
1 files changed, 8 insertions(+), 4 deletions(-)

M fontsel.c
M fontsel.c => fontsel.c +8 -4
@@ 164,10 164,14 @@ findfonts(char *prefix)
	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)