Author: rafan
Date: Mon Oct 26 13:01:29 2009
New Revision: 198489
URL: http://svn.freebsd.org/changeset/base/198489

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

Modified:
  vendor/ncurses/dist/ncurses/base/lib_getch.c

Modified: vendor/ncurses/dist/ncurses/base/lib_getch.c
==============================================================================
--- vendor/ncurses/dist/ncurses/base/lib_getch.c        Mon Oct 26 11:26:49 
2009        (r198488)
+++ vendor/ncurses/dist/ncurses/base/lib_getch.c        Mon Oct 26 13:01:29 
2009        (r198489)
@@ -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);
            }
        }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to