[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH] winio: fix initial state of blocking-io

From: Lion Yang
Subject: [Nano-devel] [PATCH] winio: fix initial state of blocking-io
Date: Sat, 04 Nov 2017 23:16:25 +0800

winio.c assumes waiting_mode = TRUE but stdin can be non-blocking
when a program (before nano) turned stdin to non-blocking mode and did not
recover it (or crashed before recovering blocking mode). This commit
set stdin blocking mode in nano.c

This 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.

Attachment: 0001-winio-fix-initial-state-of-blocking-io.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]