aboutsummaryrefslogtreecommitdiff
path: root/readline
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-01-23 09:04:43 -0700
committerTom Tromey <tom@tromey.com>2021-01-23 09:24:20 -0700
commitef45cb65a7be9f80686233d0e5586ced81613db0 (patch)
tree0da043d282d2c2a517ec1823b0fd81534175ca32 /readline
parent1af4c9c4209c3478224f18dfb79dc09567b96705 (diff)
downloadbinutils-ef45cb65a7be9f80686233d0e5586ced81613db0.zip
binutils-ef45cb65a7be9f80686233d0e5586ced81613db0.tar.gz
binutils-ef45cb65a7be9f80686233d0e5586ced81613db0.tar.bz2
Use readline's variant of Windows patch
A while back, Eli sent a patch to readline that was incorporated by upstream readline in a slightly different form. To cut down on divergences between GDB and upstream readline, I am checking in this patch to use the readline code. readline/readline/ChangeLog.gdb 2021-01-23 Tom Tromey <tom@tromey.com> * input.c [_WIN32]: Use code from upstream readline.
Diffstat (limited to 'readline')
-rw-r--r--readline/readline/ChangeLog.gdb4
-rw-r--r--readline/readline/input.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/readline/readline/ChangeLog.gdb b/readline/readline/ChangeLog.gdb
index 0b3d1ab..71161cb 100644
--- a/readline/readline/ChangeLog.gdb
+++ b/readline/readline/ChangeLog.gdb
@@ -1,3 +1,7 @@
+2021-01-23 Tom Tromey <tom@tromey.com>
+
+ * input.c [_WIN32]: Use code from upstream readline.
+
2019-10-23 Andrew Burgess <andrew.burgess@embecosm.com>
PR cli/24980
diff --git a/readline/readline/input.c b/readline/readline/input.c
index 95ace84..d4d57a8 100644
--- a/readline/readline/input.c
+++ b/readline/readline/input.c
@@ -99,16 +99,16 @@ static int ibuffer_space PARAMS((void));
static int rl_get_char PARAMS((int *));
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__)
-
-/* 'isatty' in the Windows runtime returns non-zero for every
- character device, including the null device. Repair that. */
#include <io.h>
#include <conio.h>
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
-int w32_isatty (int fd)
+int
+win32_isatty (int fd)
{
if (_isatty(fd))
{
@@ -127,7 +127,7 @@ int w32_isatty (int fd)
return 0;
}
-#define isatty(x) w32_isatty(x)
+#define isatty(x) win32_isatty(x)
#endif
/* **************************************************************** */