summaryrefslogtreecommitdiff
path: root/ext/readline/readline.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/readline/readline.c')
-rw-r--r--ext/readline/readline.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 14859a96bb..4bd9103462 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -170,7 +170,10 @@ ZEND_GET_MODULE(readline)
PHP_MINIT_FUNCTION(readline)
{
- using_history();
+#if HAVE_LIBREADLINE
+ /* libedit don't need this call which set the tty in cooked mode */
+ using_history();
+#endif
return PHP_MINIT(cli_readline)(INIT_FUNC_ARGS_PASSTHRU);
}
@@ -351,6 +354,11 @@ PHP_FUNCTION(readline_clear_history)
return;
}
+#if HAVE_LIBEDIT
+ /* clear_history is the only function where rl_initialize
+ is not call to ensure correct allocation */
+ using_history();
+#endif
clear_history();
RETURN_TRUE;