summaryrefslogtreecommitdiffstats
path: root/lldb/tools/driver/IOChannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/tools/driver/IOChannel.cpp')
-rw-r--r--lldb/tools/driver/IOChannel.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/tools/driver/IOChannel.cpp b/lldb/tools/driver/IOChannel.cpp
index a553ff67fb6..b6d4224a790 100644
--- a/lldb/tools/driver/IOChannel.cpp
+++ b/lldb/tools/driver/IOChannel.cpp
@@ -55,7 +55,15 @@ IOChannel::EditLineHasCharacters ()
{
const LineInfo *line_info = el_line(m_edit_line);
if (line_info)
- return line_info->cursor != line_info->buffer;
+ {
+ // Sometimes we get called after the user has submitted the line, but before editline has
+ // cleared the buffer. In that case the cursor will be pointing at the newline. That's
+ // equivalent to having no characters on the line, since it has already been submitted.
+ if (*line_info->cursor == '\n')
+ return false;
+ else
+ return line_info->cursor != line_info->buffer;
+ }
else
return false;
}
OpenPOWER on IntegriCloud