This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] tui: Fix newterm call for older ncurses
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Tue, 4 Nov 2014 08:31:25 -0500
- Subject: [PATCH] tui: Fix newterm call for older ncurses
- Authentication-results: sourceware.org; auth=none
Older versions of ncurses' newterm can't take NULL for their ofp and ifp
parameters. Newer versions can, and they fall back on stdout/stdin if
that is the case.
This patch explicitely passes stdout/stdin to the call to newterm to
avoid segfaulting with older ncurses.
Reference: https://sourceware.org/ml/gdb-patches/2014-11/msg00055.html
gdb/Changelog:
2014-11-04 Simon Marchi <simon.marchi@ericsson.com>
* tui/tui.c (tui_enable): Pass pass stdout and stdin to newterm.
---
gdb/tui/tui.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index cb85fb0..12ddab3 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -424,7 +424,7 @@ tui_enable (void)
if (!ui_file_isatty (gdb_stdout))
error (_("Cannot enable the TUI when output is not a terminal"));
- s = newterm (NULL, NULL, NULL);
+ s = newterm (NULL, stdout, stdin);
if (s == NULL)
{
error (_("Cannot enable the TUI: error opening terminal [TERM=%s]"),
--
2.1.1