svn commit: r198693 - in stable/8/contrib/ncurses: . ncurses/base

Rong-En Fan rafan at FreeBSD.org
Fri Oct 30 17:28:36 UTC 2009


Author: rafan
Date: Fri Oct 30 17:28:35 2009
New Revision: 198693
URL: http://svn.freebsd.org/changeset/base/198693

Log:
  MFC r198490
  
   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

Modified:
  stable/8/contrib/ncurses/   (props changed)
  stable/8/contrib/ncurses/ncurses/base/lib_getch.c

Modified: stable/8/contrib/ncurses/ncurses/base/lib_getch.c
==============================================================================
--- stable/8/contrib/ncurses/ncurses/base/lib_getch.c	Fri Oct 30 16:59:58 2009	(r198692)
+++ stable/8/contrib/ncurses/ncurses/base/lib_getch.c	Fri Oct 30 17:28:35 2009	(r198693)
@@ -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);
 	    }
 	}


More information about the svn-src-all mailing list