diff --git a/ChangeLog b/ChangeLog
index aab8dc3e8a17b374354666835e2aeeaf624742a9..e0c41ebc5f000cfbb6f9704a570ce8c401ab064d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -63,7 +63,8 @@ CVS code -
 	  row, hang up regardless of the value of errno.  This fixes a
 	  problem where nano doesn't terminate properly under xterm if
 	  the user su's to root, runs nano, and then closes the terminal
-	  window. (DLR, found by John <acocaracha@gmail.com>)
+	  window.  errno isn't set properly to EIO then. (DLR, found by
+	  John <acocaracha@gmail.com>)
   parse_kbinput()
 	- Interpret Shift-Begin, Shift-Delete, Shift-End, Shift-Home,
 	  Shift-Insert, and Shift-Suspend as Begin, Delete, End, Home,
diff --git a/src/nano.c b/src/nano.c
index 408a7dc002a704ee32974525f71c8b3d06a0792b..1c923999a385de2cc58d928dde34c7d0991d3f22 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1044,10 +1044,10 @@ RETSIGTYPE handle_sigwinch(int signal)
     if (result == -1)
 	return;
 
-    /* Could check whether the COLS or LINES changed, and return
-     * otherwise.  EXCEPT, that COLS and LINES are ncurses global
-     * variables, and in some cases ncurses has already updated them. 
-     * But not in all cases, argh. */
+    /* We could check whether the COLS or LINES changed, and return
+     * otherwise.  However, COLS and LINES are curses global variables,
+     * and in some cases curses has already updated them.  But not in
+     * all cases.  Argh. */
     COLS = win.ws_col;
     LINES = win.ws_row;
 
diff --git a/src/winio.c b/src/winio.c
index ae6a1290b3fef4bde4ef17493806532ffa3edffa..b9c9e1f1e94d37dc3c0a7a4e7459a5db32d97164 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -142,12 +142,12 @@ void get_key_buffer(WINDOW *win)
     while ((input = wgetch(win)) == ERR) {
 	errcount++;
 
-	/* If errno is EIO, it means that the input source that we were
-	 * using is gone, so die gracefully.  If we've failed to get a
-	 * character over MAX_BUF_SIZE times in a row, it can mean the
-	 * same thing regardless of the value of errno, so die
-	 * gracefully then too. */
-	if (errno == EIO || errcount > MAX_BUF_SIZE)
+	/* If we've failed to get a character over MAX_BUF_SIZE times in
+	 * a row, assume that the input source we were using is gone and
+	 * die gracefully.  We could check if errno is set to EIO
+	 * ("Input/output error") and die gracefully in that case, but
+	 * it's not always set properly.  Argh. */
+	if (errcount > MAX_BUF_SIZE)
 	    handle_hupterm(0);
     }