Browse Source

Merge branch 'PHP-7.0'

* PHP-7.0:
  Fixed bug #72538 (readline_redisplay crashes php)
pull/1981/head
Xinchen Hui 10 years ago
parent
commit
ee2d662434
  1. 5
      ext/readline/readline.c
  2. 15
      ext/readline/tests/bug72538.phpt

5
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();
}
/* }}} */

15
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
Loading…
Cancel
Save