diff options
| author | Kamil Rytarowski <n54@gmx.com> | 2017-05-25 20:12:30 +0000 |
|---|---|---|
| committer | Kamil Rytarowski <n54@gmx.com> | 2017-05-25 20:12:30 +0000 |
| commit | 8855c2ca19d4f5198305ff83a48d9925e5c6aa7e (patch) | |
| tree | 1bfa105563595891fb5a8213869eedd480bb5add /lldb/source/Host/common/Editline.cpp | |
| parent | 3bfbd70840c5f27a65f921d3af5cad0d2f390817 (diff) | |
| download | bcm5719-llvm-8855c2ca19d4f5198305ff83a48d9925e5c6aa7e.tar.gz bcm5719-llvm-8855c2ca19d4f5198305ff83a48d9925e5c6aa7e.zip | |
Fix bug #28898
lldb: libedit produces garbled, unusable input on Linux
Apply patch from Christos Zoulas, upstream libedit developer.
It has been tested on NetBSD/amd64.
New code supports combination of wide libedit and disabled
LLDB_EDITLINE_USE_WCHAR, which was the popular case on Linux
systems.
llvm-svn: 303907
Diffstat (limited to 'lldb/source/Host/common/Editline.cpp')
| -rw-r--r-- | lldb/source/Host/common/Editline.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp index 7d4b398a171..7b580dde656 100644 --- a/lldb/source/Host/common/Editline.cpp +++ b/lldb/source/Host/common/Editline.cpp @@ -474,7 +474,7 @@ unsigned char Editline::RecallHistory(bool earlier) { return CC_NEWLINE; } -int Editline::GetCharacter(EditLineCharType *c) { +int Editline::GetCharacter(EditLineGetCharType *c) { const LineInfoW *info = el_wline(m_editline); // Paint a faint version of the desired prompt over the version libedit draws @@ -969,7 +969,7 @@ void Editline::ConfigureEditor(bool multiline) { })); el_wset(m_editline, EL_GETCFN, (EditlineGetCharCallbackType)([]( - EditLine *editline, EditLineCharType *c) { + EditLine *editline, EditLineGetCharType *c) { return Editline::InstanceFor(editline)->GetCharacter(c); })); @@ -1360,12 +1360,12 @@ void Editline::PrintAsync(Stream *stream, const char *s, size_t len) { } } -bool Editline::CompleteCharacter(char ch, EditLineCharType &out) { +bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) { #if !LLDB_EDITLINE_USE_WCHAR if (ch == (char)EOF) return false; - out = ch; + out = (unsigned char)ch; return true; #else std::codecvt_utf8<wchar_t> cvt; |

