|
From: | Lion Yang |
Subject: | Re: [Nano-devel] [PATCH] winio: fix initial state of blocking-io |
Date: | Sun, 05 Nov 2017 00:17:51 +0800 |
winio.c assumes waiting_mode = TRUE but stdin can be non-blockingwhen a program (before nano) turned stdin to non-blocking mode and did notrecover it (or crashed before recovering blocking mode). This commitset stdin blocking mode in nano.cThis should fix the bug reported in"[Help-nano] Too many errors from stdin"from Roman Tereshkov.That was because nano treat the stdin as blocking (`static bool waiting_mode = TRUE`),).Nano tried to do `input = wgetch(win)`, but obviously it always returns ERR in non-blocking mode,and the branch `if (input == ERR && !waiting_mode) ... return;` had no effect.
[Prev in Thread] | Current Thread | [Next in Thread] |