diff options
author | Xinchen Hui <laruence@gmail.com> | 2016-07-03 23:57:02 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2016-07-03 23:57:02 +0800 |
commit | ee2d6624342bec69fd13408b876ed5a80fcad025 (patch) | |
tree | 60496ff558feae188968e9ff4cbe451718d48e5d /ext/readline | |
parent | 4fddc3889e09943faba7eff370ef8ce882853233 (diff) | |
parent | 612aff3a8a42bb5ef756e60769b16f9879c7f036 (diff) | |
download | php-git-ee2d6624342bec69fd13408b876ed5a80fcad025.tar.gz |
Merge branch 'PHP-7.0'
* PHP-7.0:
Fixed bug #72538 (readline_redisplay crashes php)
Diffstat (limited to 'ext/readline')
-rw-r--r-- | ext/readline/readline.c | 5 | ||||
-rw-r--r-- | ext/readline/tests/bug72538.phpt | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 9c637427f7..29c96791a8 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -626,6 +626,11 @@ PHP_FUNCTION(readline_callback_handler_remove) Ask readline to redraw the display */ PHP_FUNCTION(readline_redisplay) { +#if HAVE_LIBEDIT + /* seems libedit doesn't take care of rl_initialize in rl_redisplay + * see bug #72538 */ + using_history(); +#endif rl_redisplay(); } /* }}} */ diff --git a/ext/readline/tests/bug72538.phpt b/ext/readline/tests/bug72538.phpt new file mode 100644 index 0000000000..98b9b2651e --- /dev/null +++ b/ext/readline/tests/bug72538.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #72538 (readline_redisplay crashes php) +--SKIPIF-- +<?php if (!extension_loaded("readline")) die("skip"); +if (READLINE_LIB != "libedit") die("skip libedit only"); +?> +--FILE-- +<?php + +readline_redisplay(); + +?> +okey +--EXPECT-- +okey |