X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=ncurses%2Fbase%2Fwresize.c;h=5eb6a30482f52a20d3d0c787f69fd3eccbcfbb79;hb=f8401f5e8669eadd551fde12da7de661c18fa4f2;hp=93276ef5c42b201006cfd8b53943f1f865db87f9;hpb=47d2fb4537d9ad5bb14f4810561a327930ca4280;p=ncurses.git diff --git a/ncurses/base/wresize.c b/ncurses/base/wresize.c index 93276ef5..5eb6a304 100644 --- a/ncurses/base/wresize.c +++ b/ncurses/base/wresize.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 2019-2020,2021 Thomas E. Dickey * * Copyright 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -34,7 +34,7 @@ #include -MODULE_ID("$Id: wresize.c,v 1.39 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: wresize.c,v 1.42 2021/10/23 18:54:16 tom Exp $") static int cleanup_lines(struct ldat *data, int length) @@ -135,7 +135,7 @@ wresize(WINDOW *win, int ToLines, int ToCols) && ToCols == size_x) returnCode(OK); - if ((win->_flags & _SUBWIN)) { + if (IS_SUBWIN(win)) { /* * Check if the new limits will fit into the parent window's size. If * not, do not resize. We could adjust the location of the subwindow, @@ -169,14 +169,22 @@ wresize(WINDOW *win, int ToLines, int ToCols) int end = ToCols; NCURSES_CH_T *s; - if (!(win->_flags & _SUBWIN)) { + if (!IS_SUBWIN(win)) { if (row <= size_y) { if (ToCols != size_x) { s = typeMalloc(NCURSES_CH_T, (unsigned) ToCols + 1); if (s == 0) returnCode(cleanup_lines(new_lines, row)); for (col = 0; col <= ToCols; ++col) { - s[col] = (col <= size_x + bool valid = (col <= size_x); + if_WIDEC({ + if (col == ToCols + && col < size_x + && isWidecBase(win->_line[row].text[col])) { + valid = FALSE; + } + }); + s[col] = (valid ? win->_line[row].text[col] : win->_nc_bkgd); }