summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-02-18 20:49:45 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-02-18 21:18:37 +0900
commit9a5da2dcff51dfd845246cc21645369d1f7201c8 (patch)
treea815b32359f23e498c211b5462e72e2e5d7d8752 /ext/readline
parent9110021fd220dc5fdd3937533db8620ba57ce386 (diff)
[ruby/readline-ext] Initialize libedit before managing the history
Fixes https://bugs.ruby-lang.org/issues/17629 https://github.com/ruby/readline-ext/commit/250d6787ed
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 9f76f90e41..b804ae6ae2 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -2088,6 +2088,7 @@ Init_readline(void)
#if defined HAVE_CLEAR_HISTORY || defined HAVE_REMOVE_HISTORY
if (strncmp(rl_library_version, EDIT_LINE_LIBRARY_VERSION,
strlen(EDIT_LINE_LIBRARY_VERSION)) == 0) {
+ prepare_readline();
add_history("1");
if (history_get(history_get_offset_func(0)) == NULL) {
history_get_offset_func = history_get_offset_0;