commit bash-20200420 snapshot

This commit is contained in:
Chet Ramey
2020-04-22 16:45:28 -04:00
parent 3235014e5b
commit 87d2ae2ae5
17 changed files with 395 additions and 71 deletions
+19 -2
View File
@@ -349,8 +349,7 @@ _rl_input_available (void)
FD_ZERO (&exceptfds);
FD_SET (tty, &readfds);
FD_SET (tty, &exceptfds);
timeout.tv_sec = 0;
timeout.tv_usec = _keyboard_input_timeout;
USEC_TO_TIMEVAL (_keyboard_input_timeout, timeout);
return (select (tty + 1, &readfds, (fd_set *)NULL, &exceptfds, &timeout) > 0);
#else
@@ -369,6 +368,24 @@ _rl_input_available (void)
return 0;
}
int
_rl_nchars_available ()
{
int chars_avail, fd, result;
chars_avail = 0;
#if defined (FIONREAD)
fd = fileno (rl_instream);
errno = 0;
result = ioctl (fd, FIONREAD, &chars_avail);
if (result == -1 && errno == EIO)
return -1;
#endif
return chars_avail;
}
int
_rl_input_queued (int t)
{