From b172cb7a68e168f3382e91c7e9c3c2f753f63fc5 Mon Sep 17 00:00:00 2001 From: fcambus Date: Sat, 17 Jun 2017 19:20:30 +0000 Subject: [PATCH] The fonts we are looping through in vga_selectfont() are the builtin font which is using the IBM encoding, and some potentially loaded fonts which are either IBM or ISO encoded. Therefore the condition checked by vga_valid_font() is always true, and we can remove it. Thanks to miod@ for pointing this out. OK tb@ --- sys/dev/ic/vga.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index 076b78afe28..74cc3e07bf8 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga.c,v 1.68 2015/09/09 18:23:39 deraadt Exp $ */ +/* $OpenBSD: vga.c,v 1.69 2017/06/17 19:20:30 fcambus Exp $ */ /* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */ /*- @@ -344,10 +344,6 @@ bad: * We want at least ASCII 32..127 be present in the * first font slot. */ -#define vga_valid_primary_font(f) \ - (f->encoding == WSDISPLAY_FONTENC_IBM || \ - f->encoding == WSDISPLAY_FONTENC_ISO) - int vga_selectfont(struct vga_config *vc, struct vgascreen *scr, const char *name1, const char *name2) /* NULL: take first found */ @@ -362,9 +358,7 @@ vga_selectfont(struct vga_config *vc, struct vgascreen *scr, const char *name1, struct vgafont *f = vc->vc_fonts[i]; if (!f || f->height != type->fontheight) continue; - if (!f1 && - vga_valid_primary_font(f) && - (!name1 || !*name1 || + if (!f1 && (!name1 || !*name1 || !strncmp(name1, f->name, WSFONT_NAME_SIZE))) { f1 = f; continue; -- 2.20.1