From: nhmall Date: Mon, 9 May 2022 00:27:00 +0000 (-0400) Subject: regression in process_text_window() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2047d42bc6cc49e8546a3027e8b2e55396c3ad0b;p=nethack regression in process_text_window() original code: if (linestart && (*cp & 0x80) != 0) { g_putch(*cp); end_glyphout(); linestart = FALSE; } else { (void) putchar(*cp); } new code: if (linestart) { if (SYMHANDLING(H_UTF8)) { /* FIXME: what is actually in that line? is it the \GNNNNNNNN or UTF-8? */ g_putch(*cp); } else if ((*cp & 0x80) != 0) { g_putch(*cp); end_glyphout(); } linestart = FALSE; } else { (void) putchar(*cp); } The new code didn't output a character if linestart was true and the character did not have bit 0x80 set. fixed code: if (linestart) { if (SYMHANDLING(H_UTF8)) { /* FIXME: what is actually in that line? is it the \GNNNNNNNN or UTF-8? */ g_putch(*cp); } else if ((*cp & 0x80) != 0) { g_putch(*cp); end_glyphout(); } else { (void) putchar(*cp); } linestart = FALSE; } else { (void) putchar(*cp); } --- diff --git a/win/tty/wintty.c b/win/tty/wintty.c index f3d10a962..f2c36bf5c 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -2368,6 +2368,8 @@ process_text_window(winid window, struct WinDesc *cw) } else if ((*cp & 0x80) != 0) { g_putch(*cp); end_glyphout(); + } else { + (void) putchar(*cp); } linestart = FALSE; } else {