Skip to content

Commit

Permalink
MFC r198490
Browse files Browse the repository at this point in the history
 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
  • Loading branch information
rafan committed Oct 30, 2009
1 parent b9c1f44 commit 5e778a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contrib/ncurses/ncurses/base/lib_getch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 5e778a0

Please sign in to comment.