From 2e7406ade90ee59ada54f8851a5d1d675a222044 Mon Sep 17 00:00:00 2001 From: David Griffith Date: Tue, 3 Jan 2023 20:58:14 -0800 Subject: [PATCH] Reworked faulty show_cell_normal() from the old IRC formatting code. Philip Lafleur's patch at http://ifarchive.org/if-archive/infocom/interpreters/frotz/frotz-2.43-irc.diff.gz did not account for the possibility of the text style having more than one value. I didn't catch this oversight at the time. --- src/dumb/doutput.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/dumb/doutput.c b/src/dumb/doutput.c index dc88ac3..28f5b3a 100644 --- a/src/dumb/doutput.c +++ b/src/dumb/doutput.c @@ -358,15 +358,7 @@ static void show_cell_bbcode(cell_t cel) /* Print a cell to stdout without using formatting codes. */ static void show_cell_normal(cell_t cel) { - switch (cel.style) { - case NORMAL_STYLE: - case FIXED_WIDTH_STYLE: /* NORMAL_STYLE falls through to here */ - zputchar(cel.c); - break; - case PICTURE_STYLE: - zputchar(show_pictures ? cel.c : ' '); - break; - case REVERSE_STYLE: + if (cel.style & REVERSE_STYLE) { if (cel.c == ' ') printf("%s", rv_blank_str); else { @@ -391,8 +383,11 @@ static void show_cell_normal(cell_t cel) break; } } - break; } + else if (cel.style & PICTURE_STYLE) + zputchar(show_pictures ? cel.c : ' '); + else /* Only NORMAL_STYLE and FIXED_WIDTH_STYLE are left. */ + zputchar(cel.c); } -- 2.34.1