mirror of
https://github.com/digarok/gsplus.git
synced 2024-05-28 13:41:31 +00:00
fix GNU readline bug. linking libhistory is not necessary. In fact, it causes a SIGSEGV.
This commit is contained in:
parent
14e1fe18f8
commit
2f05a766b0
|
@ -165,7 +165,7 @@ if (READLINE MATCHES "AUTO")
|
|||
endif()
|
||||
if(READLINE MATCHES "READLINE")
|
||||
target_compile_definitions(x_readline PRIVATE USE_READLINE)
|
||||
target_link_libraries(x_readline PUBLIC history readline)
|
||||
target_link_libraries(x_readline PUBLIC readline)
|
||||
elseif(READLINE MATCHES "LIBEDIT")
|
||||
target_compile_definitions(x_readline PRIVATE USE_LIBEDIT)
|
||||
target_link_libraries(x_readline PUBLIC edit)
|
||||
|
|
|
@ -121,7 +121,7 @@ char *x_readline(const char *prompt) {
|
|||
|
||||
/* append to history, but only if unique from prev. entry */
|
||||
if (*buffer) {
|
||||
HIST_ENTRY *h = history_get(history_length-1);
|
||||
HIST_ENTRY *h = history_get(history_length);
|
||||
if (h == NULL || strcmp(buffer, h->line))
|
||||
add_history(buffer);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user