Reworked faulty show_cell_normal() from the old IRC formatting code.
authorDavid Griffith <dave@661.org>
Wed, 4 Jan 2023 04:58:14 +0000 (20:58 -0800)
committerDavid Griffith <dave@661.org>
Wed, 4 Jan 2023 05:01:31 +0000 (21:01 -0800)
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

index dc88ac3650b77c4f998e5557f217ec3a7e2a9a68..28f5b3aeab162334dda1357737bfdc2bc5ba6528 100644 (file)
@@ -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);
 }