1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00

Pull upstream patch to fix ee(1) crash when received SIGWINCH:

modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a
  SIGWINCH, and discard that value, to avoid confusing application
  (patch by Eygene Ryabinkin, FreeBSD bin/136223).

PR:		136223
Submitted by:	Eygene Ryabinkin
Obtained from:	ncurses-5.7-20091024 snapshot
MFC after:	3 days
This commit is contained in:
Rong-En Fan 2009-10-26 13:01:29 +00:00
parent 6181f4622a
commit 90f241383e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/ncurses/dist/; revision=198489

View File

@ -476,6 +476,12 @@ _nc_wgetch(WINDOW *win,
/* resizeterm can push KEY_RESIZE */
if (cooked_key_in_fifo()) {
*result = fifo_pull(sp);
/*
* Get the ERR from queue -- it is from WINCH,
* so we should take it out, the "error" is handled.
*/
if (fifo_peek(sp) == -1)
fifo_pull(sp);
returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK);
}
}