php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #54450
Patch readline-libedit-5.3.7.patch revision 2011-07-29 05:36 UTC by Fedora at FamilleCollet dot com
Patch readline-libedit.patch revision 2011-04-02 07:35 UTC by fedora at famillecollet dot com

Patch readline-libedit.patch for Readline related Bug #54450

Patch version 2011-04-02 07:35 UTC

Return to Bug #54450 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: fedora@famillecollet.com

diff -up php-5.3.6/ext/readline/config.m4.orig php-5.3.6/ext/readline/config.m4
--- php-5.3.6/ext/readline/config.m4.orig	2011-04-02 08:42:54.149398002 +0200
+++ php-5.3.6/ext/readline/config.m4	2011-04-02 09:04:59.138245014 +0200
@@ -60,6 +60,13 @@ if test "$PHP_READLINE" && test "$PHP_RE
     -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
   ])
 
+  PHP_CHECK_LIBRARY(edit, rl_on_new_line,
+  [
+    AC_DEFINE(HAVE_RL_ON_NEW_LINE, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
+  ])
+
   AC_DEFINE(HAVE_LIBREADLINE, 1, [ ])
 
 elif test "$PHP_LIBEDIT" != "no"; then
@@ -93,6 +100,20 @@ elif test "$PHP_LIBEDIT" != "no"; then
     -L$READLINE_DIR/$PHP_LIBDIR 
   ])
 
+  PHP_CHECK_LIBRARY(edit, rl_callback_read_char,
+  [
+    AC_DEFINE(HAVE_RL_CALLBACK_READ_CHAR, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR
+  ])
+
+  PHP_CHECK_LIBRARY(edit, rl_on_new_line,
+  [
+    AC_DEFINE(HAVE_RL_ON_NEW_LINE, 1, [ ])
+  ],[],[
+    -L$READLINE_DIR/$PHP_LIBDIR
+  ])
+
   AC_DEFINE(HAVE_LIBEDIT, 1, [ ])
 fi
 
diff -up php-5.3.6/ext/readline/readline.c.orig php-5.3.6/ext/readline/readline.c
--- php-5.3.6/ext/readline/readline.c.orig	2011-04-02 08:56:21.415910605 +0200
+++ php-5.3.6/ext/readline/readline.c	2011-04-02 08:59:44.785327260 +0200
@@ -141,6 +141,8 @@ static const zend_function_entry php_rea
 	PHP_FE(readline_callback_read_char,			arginfo_readline_callback_read_char)
 	PHP_FE(readline_callback_handler_remove,	arginfo_readline_callback_handler_remove)
 	PHP_FE(readline_redisplay, arginfo_readline_redisplay)
+#endif
+#if HAVE_RL_ON_NEW_LINE
 	PHP_FE(readline_on_new_line, arginfo_readline_on_new_line)
 #endif
 	{NULL, NULL, NULL}
@@ -598,6 +600,9 @@ PHP_FUNCTION(readline_redisplay)
 }
 /* }}} */
 
+#endif
+
+#if HAVE_RL_ON_NEW_LINE
 /* {{{ proto void readline_on_new_line(void)
    Inform readline that the cursor has moved to a new line */
 PHP_FUNCTION(readline_on_new_line)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 21:01:28 2024 UTC