aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-03-19 17:29:48 +0300
committerZyX <kp-pav@yandex.ru>2017-03-19 17:29:48 +0300
commite78e75d85d91e9f14964465ea136b3899b774d6e (patch)
tree619520179b6a24aa62586e8a862a6df8f371fedc /src/nvim/getchar.c
parentbd798a3267a496c644b339c45189b09e2a952014 (diff)
downloadrneovim-e78e75d85d91e9f14964465ea136b3899b774d6e.tar.gz
rneovim-e78e75d85d91e9f14964465ea136b3899b774d6e.tar.bz2
rneovim-e78e75d85d91e9f14964465ea136b3899b774d6e.zip
fileio,main: Do not restart syscall at EAGAIN when reading for -s
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index b6e235146e..4ea8eb0513 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -2375,7 +2375,7 @@ inchar (
// Get a character from a script file if there is one.
// If interrupted: Stop reading script files, close them all.
ptrdiff_t read_size = -1;
- while (scriptin[curscript] != NULL && read_size < 0 && !ignore_script) {
+ while (scriptin[curscript] != NULL && read_size <= 0 && !ignore_script) {
char script_char;
if (got_int
|| (read_size = file_read(scriptin[curscript], &script_char, 1)) != 1) {
@@ -2397,7 +2397,7 @@ inchar (
}
}
- if (read_size < 0) { // Did not get a character from script.
+ if (read_size <= 0) { // Did not get a character from script.
// If we got an interrupt, skip all previously typed characters and
// return TRUE if quit reading script file.
// Stop reading typeahead when a single CTRL-C was read,