Skip to content

Commit fe39fd3

Browse files
committed
Implement Adrian's suggestion
1 parent e36c407 commit fe39fd3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lldb/source/Interpreter/CommandInterpreter.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,9 +3289,8 @@ void CommandInterpreter::IOHandlerInputComplete(IOHandler &io_handler,
32893289
// from a file) we need to echo the command out so we don't just see the
32903290
// command output and no command...
32913291
if (EchoCommandNonInteractive(line, io_handler.GetFlags())) {
3292-
LockedStreamFile locked_stream =
3293-
io_handler.GetOutputStreamFileSP()->Lock();
3294-
locked_stream.Printf("%s%s\n", io_handler.GetPrompt(), line.c_str());
3292+
io_handler.GetOutputStreamFileSP()->Lock()
3293+
<< io_handler.GetPrompt() << line << '\n';
32953294
echoed_command = true;
32963295
}
32973296
}
@@ -3323,9 +3322,8 @@ void CommandInterpreter::IOHandlerInputComplete(IOHandler &io_handler,
33233322
// If the command failed and we didn't echo it, echo it now so the user
33243323
// knows which command produced the error.
33253324
if (!echoed_command && !result.Succeeded() && print_error) {
3326-
LockedStreamFile locked_stream =
3327-
io_handler.GetOutputStreamFileSP()->Lock();
3328-
locked_stream.Printf("%s%s\n", io_handler.GetPrompt(), line.c_str());
3325+
io_handler.GetOutputStreamFileSP()->Lock()
3326+
<< io_handler.GetPrompt() << line << '\n';
33293327
}
33303328

33313329
auto DefaultPrintCallback = [&](const CommandReturnObject &result) {

0 commit comments

Comments
 (0)