mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Minimal readline support
This commit is contained in:
parent
6b1cdbca8b
commit
6f5ef70a14
@ -162,9 +162,16 @@ LineReader::InputStatus LineReader::readOneLine(const String & prompt)
|
||||
}
|
||||
else
|
||||
{
|
||||
void * dl_handle = dlopen("libreadline.so", RTLD_LAZY);
|
||||
if (dl_handle)
|
||||
readline_ptr = reinterpret_cast<char * (*)(const char *)>(dlsym(dl_handle, "readline"));
|
||||
for (auto name : {"libreadline.so", "libreadline.so.0", "libeditline.so", "libeditline.so.0"})
|
||||
{
|
||||
void * dl_handle = dlopen(name, RTLD_LAZY);
|
||||
if (dl_handle)
|
||||
{
|
||||
readline_ptr = reinterpret_cast<char * (*)(const char *)>(dlsym(dl_handle, "readline"));
|
||||
if (readline_ptr)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user