From owner-svn-src-stable@FreeBSD.ORG Fri Oct 30 17:28:36 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C977106566C; Fri, 30 Oct 2009 17:28:36 +0000 (UTC) (envelope-from rafan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6C68FC0C; Fri, 30 Oct 2009 17:28:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9UHSaIL052958; Fri, 30 Oct 2009 17:28:36 GMT (envelope-from rafan@svn.freebsd.org) Received: (from rafan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9UHSaw7052956; Fri, 30 Oct 2009 17:28:36 GMT (envelope-from rafan@svn.freebsd.org) Message-Id: <200910301728.n9UHSaw7052956@svn.freebsd.org> From: Rong-En Fan Date: Fri, 30 Oct 2009 17:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198693 - in stable/8/contrib/ncurses: . ncurses/base X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Oct 2009 17:28:36 -0000 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); } }