Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lldb/source/Core/IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,16 @@ void IOHandlerConfirm::IOHandlerComplete(IOHandler &io_handler,

void IOHandlerConfirm::IOHandlerInputComplete(IOHandler &io_handler,
std::string &line) {
if (line.empty()) {
const llvm::StringRef input = llvm::StringRef(line).rtrim();
if (input.empty()) {
// User just hit enter, set the response to the default
m_user_response = m_default_response;
io_handler.SetIsDone(true);
return;
}

if (line.size() == 1) {
switch (line[0]) {
if (input.size() == 1) {
switch (input[0]) {
case 'y':
case 'Y':
m_user_response = true;
Expand All @@ -176,10 +177,10 @@ void IOHandlerConfirm::IOHandlerInputComplete(IOHandler &io_handler,
}
}

if (line == "yes" || line == "YES" || line == "Yes") {
if (input.compare_insensitive("yes")) {
m_user_response = true;
io_handler.SetIsDone(true);
} else if (line == "no" || line == "NO" || line == "No") {
} else if (input.compare_insensitive("no")) {
m_user_response = false;
io_handler.SetIsDone(true);
}
Expand Down
Loading