Fix an illegal memory access triggered when trying to examine an input file containin...
[deliverable/binutils-gdb.git] / gdb / ui-file.c
index 05d411aa3929f8fe8bca7582440cf7e5a2797203..af128b08f54f73575d567e7c19a6ad60311ca746 100644 (file)
@@ -1,6 +1,6 @@
 /* UI_FILE - a generic STDIO like output stream.
 
-   Copyright (C) 1999-2019 Free Software Foundation, Inc.
+   Copyright (C) 1999-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -23,7 +23,8 @@
 #include "ui-file.h"
 #include "gdb_obstack.h"
 #include "gdb_select.h"
-#include "common/filestuff.h"
+#include "gdbsupport/filestuff.h"
+#include "cli/cli-style.h"
 
 null_file null_stream;
 
@@ -106,8 +107,6 @@ ui_file_isatty (struct ui_file *file)
 static bool
 term_cli_styling ()
 {
-  extern int cli_styling;
-
   if (!cli_styling)
     return false;
 
@@ -303,7 +302,7 @@ stdio_file::isatty ()
 bool
 stdio_file::can_emit_style_escape ()
 {
-  return (this == gdb_stdout
+  return ((this == gdb_stdout || this == gdb_stderr)
          && this->isatty ()
          && term_cli_styling ());
 }
@@ -392,7 +391,7 @@ tee_file::term_out ()
 bool
 tee_file::can_emit_style_escape ()
 {
-  return (this == gdb_stdout
+  return ((this == gdb_stdout || this == gdb_stderr)
          && m_one->term_out ()
          && term_cli_styling ());
 }
This page took 0.026263 seconds and 4 git commands to generate.