From 9b3aa58cf998d1c1015560b3ec172ff13fe34143 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Wed, 30 Oct 2024 12:53:15 -0400
Subject: [PATCH] Fix up previous commit

RIPtel reset to the font configured by the user, not the current
font.  Do the same here.
---
 src/syncterm/ripper.c | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/src/syncterm/ripper.c b/src/syncterm/ripper.c
index a68993f5c6..983d4259cc 100644
--- a/src/syncterm/ripper.c
+++ b/src/syncterm/ripper.c
@@ -321,6 +321,9 @@ static struct {
 	} text_region;
 
 	struct bbslist         *bbs;
+	void *default_font;
+	int   default_font_width;
+	int   default_font_height;
 } rip = {
 	RIP_STATE_BOL,
 	RIP_STATE_FLUSHING,
@@ -356,8 +359,10 @@ static struct {
 	0, 0,
 	NULL,
 	{0, 0, 0, 0, 0, 0},
-	NULL
-	,
+	NULL,
+	NULL,
+	8,
+	8,
 };
 
 static const uint16_t      rip_line_patterns[4] = {
@@ -7855,20 +7860,7 @@ rv_reset(const char * const var, const void * const data)
 	rip.text_disabled = false;
 	rip.ansi_state = ANSI_STATE_NONE;
 	_setcursortype(rip.curstype);
-	if (rip.version == RIP_VERSION_3) {
-		void *font;
-		int   width;
-		int   height;
-
-		pthread_mutex_lock(&vstatlock);
-		font = vstat.forced_font;
-		width = vstat.charwidth;
-		height = vstat.charheight;
-		pthread_mutex_unlock(&vstatlock);
-		reinit_screen(font, width, height);
-	}
-	else
-		reinit_screen((uint8_t *)conio_fontdata[0].eight_by_eight, 8, 8);
+	reinit_screen(rip.default_font, rip.default_font_width, rip.default_font_height);
 	memcpy(&curr_ega_palette, &default_ega_palette, sizeof(curr_ega_palette));
 	set_ega_palette();
 	cterm->left_margin = 1;
@@ -16229,6 +16221,18 @@ init_rip(struct bbslist *bbs)
 	rip.viewport.ex = rip.x_dim - 1;
 	rip.viewport.ey = rip.y_dim - 1;
 	rip.bbs = bbs;
+	if (rip.version == RIP_VERSION_1) {
+		rip.default_font = conio_fontdata[0].eight_by_eight;
+		rip.default_font_width = 8;
+		rip.default_font_height = 8;
+	}
+	else {
+		pthread_mutex_lock(&vstatlock);
+		rip.default_font = vstat.forced_font;
+		rip.default_font_width = vstat.charwidth;
+		rip.default_font_height = vstat.charheight;
+		pthread_mutex_unlock(&vstatlock);
+	}
 
 	pending_len = 0;
 	if (pending)
-- 
GitLab