aboutsummaryrefslogtreecommitdiffstats
path: root/ext/readline/readline.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/readline/readline.c')
-rw-r--r--ext/readline/readline.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 3ecea944d1..b654fa099b 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -108,8 +108,8 @@ static char **readline_attempted_completion_function(const char *text,
static VALUE readline_instream;
static ID id_getbyte;
-#ifdef HAVE_EDITLINE_READLINE_H
-extern int rl_getc(FILE *);
+#ifndef HAVE_RL_GETC
+#define rl_getc(f) EOF
#endif
static int readline_getc(FILE *);
@@ -260,7 +260,9 @@ readline_readline(int argc, VALUE *argv, VALUE self)
if (status) {
#if defined HAVE_RL_CLEANUP_AFTER_SIGNAL
/* restore terminal mode and signal handler*/
+#if defined HAVE_RL_FREE_LINE_STATE
rl_free_line_state();
+#endif
rl_cleanup_after_signal();
#elif defined HAVE_RL_DEPREP_TERM_FUNCTION
/* restore terminal mode */