diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2014-11-04 08:27:06 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2014-11-04 14:15:53 -0500 |
commit | c87e6d0015ae357774fa5a25e2dcfed2c1df097f (patch) | |
tree | af34a85dafd0397adb6d6f0872cecf3ae92cc213 /gdb/tui | |
parent | 441ef17f095f99bb094eb28990a92b8cdc8553b4 (diff) | |
download | gdb-c87e6d0015ae357774fa5a25e2dcfed2c1df097f.zip gdb-c87e6d0015ae357774fa5a25e2dcfed2c1df097f.tar.gz gdb-c87e6d0015ae357774fa5a25e2dcfed2c1df097f.tar.bz2 |
tui: Fix newterm call for older ncurses
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 explicitly passes stdout/stdin to the call to newterm to
avoid segfaulting with older ncurses.
gdb/Changelog:
2014-11-04 Simon Marchi <simon.marchi@ericsson.com>
* tui/tui.c (tui_enable): Pass stdout and stdin to newterm.
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui.c | 2 |
1 files changed, 1 insertions, 1 deletions
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]"), |