aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/editors/vi.c b/editors/vi.c
index dded6edb3..1770d98c5 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2220,7 +2220,7 @@ static char readit(void) // read (maybe cursor) key from stdin
2220 // get input from User- are there already input chars in Q? 2220 // get input from User- are there already input chars in Q?
2221 if (n <= 0) { 2221 if (n <= 0) {
2222 // the Q is empty, wait for a typed char 2222 // the Q is empty, wait for a typed char
2223 n = safe_read(0, readbuffer, sizeof(readbuffer)); 2223 n = safe_read(STDIN_FILENO, readbuffer, sizeof(readbuffer));
2224 if (n < 0) { 2224 if (n < 0) {
2225 if (errno == EBADF || errno == EFAULT || errno == EINVAL 2225 if (errno == EBADF || errno == EFAULT || errno == EINVAL
2226 || errno == EIO) 2226 || errno == EIO)
@@ -2243,7 +2243,7 @@ static char readit(void) // read (maybe cursor) key from stdin
2243 && ((size_t)n <= (sizeof(readbuffer) - 8)) 2243 && ((size_t)n <= (sizeof(readbuffer) - 8))
2244 ) { 2244 ) {
2245 // read the rest of the ESC string 2245 // read the rest of the ESC string
2246 int r = safe_read(0, readbuffer + n, sizeof(readbuffer) - n); 2246 int r = safe_read(STDIN_FILENO, readbuffer + n, sizeof(readbuffer) - n);
2247 if (r > 0) 2247 if (r > 0)
2248 n += r; 2248 n += r;
2249 } 2249 }
@@ -4035,7 +4035,7 @@ static void crash_test()
4035 printf("\n\n%d: \'%c\' %s\n\n\n%s[Hit return to continue]%s", 4035 printf("\n\n%d: \'%c\' %s\n\n\n%s[Hit return to continue]%s",
4036 totalcmds, last_input_char, msg, SOs, SOn); 4036 totalcmds, last_input_char, msg, SOs, SOn);
4037 fflush(stdout); 4037 fflush(stdout);
4038 while (safe_read(0, d, 1) > 0) { 4038 while (safe_read(STDIN_FILENO, d, 1) > 0) {
4039 if (d[0] == '\n' || d[0] == '\r') 4039 if (d[0] == '\n' || d[0] == '\r')
4040 break; 4040 break;
4041 } 4041 }