Remove fputs_styled_unfiltered
[binutils-gdb.git] / gdb / cli-out.c
index 5ff645b4a835a41314166d36510f6860e65e7ead..f6a508393efd29b2d8dcfe915910c8552bb2fd9f 100644 (file)
@@ -171,10 +171,13 @@ cli_ui_out::do_field_string (int fldno, int width, ui_align align,
 
   if (string)
     {
+      ui_file *stream = m_streams.back ();
+      stream->emit_style_escape (style);
       if (test_flags (unfiltered_output))
-       fputs_styled_unfiltered (string, style, m_streams.back ());
+       stream->puts_unfiltered (string);
       else
-       fputs_styled (string, style, m_streams.back ());
+       stream->puts (string);
+      stream->emit_style_escape (ui_file_style ());
     }
 
   if (after)
@@ -230,20 +233,26 @@ cli_ui_out::do_message (const ui_file_style &style,
   if (m_suppress_output)
     return;
 
-  /* Use the "no_gdbfmt" variant here to avoid recursion.
-     vfprintf_styled calls into cli_ui_out::message to handle the
-     gdb-specific printf formats.  */
-  vfprintf_styled_no_gdbfmt (m_streams.back (), style,
-                            !test_flags (unfiltered_output), format, args);
+  std::string str = string_vprintf (format, args);
+  if (!str.empty ())
+    {
+      ui_file *stream = m_streams.back ();
+      stream->emit_style_escape (style);
+      if (test_flags (unfiltered_output))
+       stream->puts_unfiltered (str.c_str ());
+      else
+       stream->puts (str.c_str ());
+      stream->emit_style_escape (ui_file_style ());
+    }
 }
 
 void
-cli_ui_out::do_wrap_hint (const char *identstring)
+cli_ui_out::do_wrap_hint (int indent)
 {
   if (m_suppress_output)
     return;
 
-  wrap_here (identstring);
+  m_streams.back ()->wrap_here (indent);
 }
 
 void