Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Oct 2009 12:58:13 +0000 (UTC)
From:      Rong-En Fan <rafan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org
Subject:   svn commit: r198716 - in releng/8.0/contrib/ncurses: . ncurses/base
Message-ID:  <200910311258.n9VCwDu7089955@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rafan
Date: Sat Oct 31 12:58:13 2009
New Revision: 198716
URL: http://svn.freebsd.org/changeset/base/198716

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
  Approved by:	re (kib@)

Modified:
  releng/8.0/contrib/ncurses/   (props changed)
  releng/8.0/contrib/ncurses/ncurses/base/lib_getch.c

Modified: releng/8.0/contrib/ncurses/ncurses/base/lib_getch.c
==============================================================================
--- releng/8.0/contrib/ncurses/ncurses/base/lib_getch.c	Sat Oct 31 12:26:40 2009	(r198715)
+++ releng/8.0/contrib/ncurses/ncurses/base/lib_getch.c	Sat Oct 31 12:58:13 2009	(r198716)
@@ -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);
 	    }
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910311258.n9VCwDu7089955>