From 11fc80a09824d8e3acce9775aff1e3b7c8a1f305 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 26 Sep 2019 07:19:26 +0000 Subject: [PATCH] kernel terminal should initialize fg and bg variables before calling TUNABLE_INT_FETCH We have two ways to check if kenv variable exists - either we check return value from TUNABLE_INT_FETCH, or we pre-initialize the variable and check if this value did change. In terminal_init() it is more convinient to use pre-initialized variables. Problem was revealed by older loader.efi, which did not set teken.* variables. Reported by: tuexen --- sys/kern/subr_terminal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/subr_terminal.c b/sys/kern/subr_terminal.c index be52d0618df..4d7665cf337 100644 --- a/sys/kern/subr_terminal.c +++ b/sys/kern/subr_terminal.c @@ -175,6 +175,7 @@ terminal_init(struct terminal *tm) teken_init(&tm->tm_emulator, &terminal_drawmethods, tm); + fg = bg = -1; TUNABLE_INT_FETCH("teken.fg_color", &fg); TUNABLE_INT_FETCH("teken.bg_color", &bg);