0005-Return-early-from-_cursesi_waddbytes-if-_cursesi_add.patch (893B)
- From c977aac84ce6c6e2737a8a072cb4116b8ee4278e Mon Sep 17 00:00:00 2001
- From: Michael Forney <mforney@mforney.org>
- Date: Thu, 3 Jun 2021 00:42:45 -0700
- Subject: [PATCH] Return early from _cursesi_waddbytes if _cursesi_addwchar
- fails
- This error may indicate that scrolling was required in a non-scrolling
- window, in which case the rest of the string should be truncated.
- ---
- lib/libcurses/addbytes.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/lib/libcurses/addbytes.c b/lib/libcurses/addbytes.c
- index e52dc310..5d783df8 100644
- --- a/lib/libcurses/addbytes.c
- +++ b/lib/libcurses/addbytes.c
- @@ -132,7 +132,7 @@ _cursesi_waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr,
- #ifdef HAVE_WCHAR
- (void)memset(&st, 0, sizeof(st));
- #endif
- - while (count > 0) {
- + while (count > 0 && err == OK) {
- #ifndef HAVE_WCHAR
- c = *bytes++;
- #ifdef DEBUG
- --
- 2.31.1