diff --git a/gdb/ui-file.c b/gdb/ui-file.c index 71b74bba19..31664d5d65 100644 --- a/gdb/ui-file.c +++ b/gdb/ui-file.c @@ -149,12 +149,6 @@ ui_file_read (struct ui_file *file, char *buf, long length_buf) return file->read (buf, length_buf); } -void -fputs_unfiltered (const char *buf, struct ui_file *file) -{ - file->puts (buf); -} - string_file::~string_file () diff --git a/gdb/utils.c b/gdb/utils.c index f7fae35729..e8cc21c8c4 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1539,7 +1539,7 @@ flush_wrap_buffer (struct ui_file *stream) { if (stream == gdb_stdout && !wrap_buffer.empty ()) { - fputs_unfiltered (wrap_buffer.c_str (), stream); + stream->puts (wrap_buffer.c_str ()); wrap_buffer.clear (); } } @@ -1688,18 +1688,10 @@ fputs_maybe_filtered (const char *linebuffer, struct ui_file *stream, || top_level_interpreter ()->interp_ui_out ()->is_mi_like_p ()) { flush_wrap_buffer (stream); - fputs_unfiltered (linebuffer, stream); + stream->puts (linebuffer); return; } - auto buffer_clearer - = make_scope_exit ([&] () - { - wrap_buffer.clear (); - wrap_column = 0; - wrap_indent = ""; - }); - /* Go through and output each character. Show line extension when this is necessary; prompt user for new page when this is necessary. */ @@ -1788,7 +1780,7 @@ fputs_maybe_filtered (const char *linebuffer, struct ui_file *stream, /* Now output indentation and wrapped string. */ if (wrap_column) { - fputs_unfiltered (wrap_indent, stream); + stream->puts (wrap_indent); if (stream->can_emit_style_escape ()) emit_style_escape (save_style, stream); /* FIXME, this strlen is what prevents wrap_indent from @@ -1816,8 +1808,6 @@ fputs_maybe_filtered (const char *linebuffer, struct ui_file *stream, lineptr++; } } - - buffer_clearer.release (); } void @@ -1826,6 +1816,12 @@ fputs_filtered (const char *linebuffer, struct ui_file *stream) fputs_maybe_filtered (linebuffer, stream, 1); } +void +fputs_unfiltered (const char *linebuffer, struct ui_file *stream) +{ + fputs_maybe_filtered (linebuffer, stream, 0); +} + /* See utils.h. */ void