matches the manual page. (DLR)
- winio.c:
get_key_buffer()
- - If we fail to get a character over MAX_BUF_SIZE times in a
- row, hang up regardless of the value of errno. This fixes a
+ - If we fail to get a character MAX_BUF_SIZE times in a 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. errno isn't set properly to EIO then. (DLR, found by
while ((input = wgetch(win)) == ERR) {
errcount++;
- /* 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
+ /* If we've failed to get a character 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)
+ if (errcount == MAX_BUF_SIZE)
handle_hupterm(0);
}