X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=ncurses%2Fbase%2Flib_refresh.c;fp=ncurses%2Fbase%2Flib_refresh.c;h=4579cbf81162053c2a8284120e4c85cf2afc9000;hb=f399f54c6c4ea2143afcbf704ce9af0be52b63fc;hp=d8444289c1528efc5ea2934b9a3c127c34e320f7;hpb=63d26709472433a4660c88461162252bf0e5fde8;p=ncurses.git diff --git a/ncurses/base/lib_refresh.c b/ncurses/base/lib_refresh.c index d8444289..4579cbf8 100644 --- a/ncurses/base/lib_refresh.c +++ b/ncurses/base/lib_refresh.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 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 * @@ -43,7 +43,7 @@ #include -MODULE_ID("$Id: lib_refresh.c,v 1.46 2020/02/02 23:34:34 tom Exp $") +MODULE_ID("$Id: lib_refresh.c,v 1.47 2021/11/06 22:22:03 tom Exp $") NCURSES_EXPORT(int) wrefresh(WINDOW *win) @@ -92,13 +92,21 @@ wnoutrefresh(WINDOW *win) T((T_CALLED("wnoutrefresh(%p)"), (void *) win)); - /* - * This function will break badly if we try to refresh a pad. - */ - if ((win == 0) - || (win->_flags & _ISPAD)) + if (win == NULL) returnCode(ERR); + /* + * Handle pads as a special case. + */ + if (IS_PAD(win)) { + returnCode(pnoutrefresh(win, + win->_pad._pad_y, + win->_pad._pad_x, + win->_pad._pad_top, + win->_pad._pad_left, + win->_pad._pad_bottom, + win->_pad._pad_right)); + } #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE)) { _tracedump("...win", win);