From e94dde391b011f1cbfc2a6b8d08ad2a07121a31f Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 9 Jan 2009 18:55:45 +0000 Subject: [PATCH] Weaken the assertion in general_textout(). It was failing in the case of double-width text (ESC # 3, ESC # 4, ESC # 6), because the string passed to it was not truncated to the same width as the clipping rectangle. (In fact, it _can't_ reliably be, in the case where the window width is odd.) So instead we just assert that we managed to _at least_ fill the clipping rectangle, not that we exactly filled it. The problem is easily reproduced by sending ESC # 8 (fill the screen with Es) followed by ESC # 3. It doesn't typically happen, though, if you _manually_ fill the screen with Es, because in that case PuTTY's terminal buffer ends up being filled with CSET_ACP | 'E' or similar, which means that general_textout() never gets called because one of the other branches of do_text_internal() does the work instead. ESC # 8 will fill the terminal buffer with genuine _Unicode_ 'E' characters, which exercises the failing code path. git-svn-id: svn://svn.tartarus.org/sgt/putty@8403 cda61777-01e9-0310-a592-d414129be87e --- windows/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/window.c b/windows/window.c index fe16c949..b2dd5e60 100644 --- a/windows/window.c +++ b/windows/window.c @@ -1325,7 +1325,7 @@ debug(("\n rect: [%d,%d %d,%d]\n", newrc.left, newrc.top, newrc.right, #ifdef FIXME_REMOVE_BEFORE_CHECKIN debug(("general_textout: done, xn=%d\n", xn)); #endif - assert(xn - x == lprc->right - lprc->left); + assert(xn - x >= lprc->right - lprc->left); } /* -- 2.11.0