commit bash-20180928 snapshot

This commit is contained in:
Chet Ramey
2018-10-01 16:19:21 -04:00
parent 3d31a311da
commit 5fab8dbf24
22 changed files with 1116 additions and 1395 deletions
+4 -4
View File
@@ -2873,14 +2873,14 @@ space_to_eol (int count)
void
_rl_clear_screen (void)
{
#ifndef __DJGPP__
#if defined (__DJGPP__)
ScreenClear ();
ScreenSetCursor (0, 0);
#else
if (_rl_term_clrpag)
tputs (_rl_term_clrpag, 1, _rl_output_character_function);
else
rl_crlf ();
#else
ScreenClear ();
ScreenSetCursor (0, 0);
#endif /* __DJGPP__ */
}
+16 -2
View File
@@ -102,15 +102,29 @@ static int rl_gather_tyi PARAMS((void));
/* Windows isatty returns true for every character device, including the null
device, so we need to perform additional checks. */
#if defined (_WIN32) && !defined (__CYGWIN__)
#include <conio.h>
#include <io.h>
#include <conio.h>
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
int
win32_isatty (int fd)
{
return (_isatty (fd) ? ((((long) (HANDLE) _get_osfhandle (fd)) & 3) == 3) : 0);
if (_isatty(fd))
{
HANDLE h;
DWORD ignored;
if ((h = (HANDLE) _get_osfhandle (fd)) == INVALID_HANDLE_VALUE)
{
errno = EBADF;
return 0;
}
if (GetConsoleMode (h, &ignored) != 0)
return 1;
}
errno = ENOTTY;
return 0;
}
#define isatty(x) win32_isatty(x)