]> granicus.if.org Git - php/commitdiff
MFH: - Fixed bug #35409 (undefined reference to 'rl_completion_matches').
authorfoobar <sniper@php.net>
Mon, 28 Nov 2005 16:51:16 +0000 (16:51 +0000)
committerfoobar <sniper@php.net>
Mon, 28 Nov 2005 16:51:16 +0000 (16:51 +0000)
NEWS
ext/readline/config.m4
ext/readline/readline.c
sapi/cli/php_cli_readline.c

diff --git a/NEWS b/NEWS
index 230cded40fc49240b0e8a1eec906c9defb2f8eda..ac43243f2d00656a9a03524272cc029f12f8238f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP                                                                        NEWS
 ?? ??? 200?, PHP 5.1.2
 - Fixed bug #35431 (PDO crashes when using LAZY fetch with fetchAll). (Wez)
 - Fixed bug #35430 (PDO crashes on incorrect FETCH_FUNC use). (Tony)
+- Fixed bug #35409 (undefined reference to 'rl_completion_matches'). (Jani)
 - Fixed bug #35399 (Since fix of bug #35273 SOAP decoding of
   soapenc:base64binary fails). (Dmitry)
 - Fixed bug #35393 (changing static protected members from outside the class,
index 2ec104c3d498f47dab4ac45267e798a27b243ff4..58d21765c14796daebb5201b11efe5a3b27c7685 100644 (file)
@@ -59,8 +59,6 @@ if test "$PHP_READLINE" != "no"; then
     -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
   ])
 
-  PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)
-  PHP_SUBST(READLINE_SHARED_LIBADD)
   AC_DEFINE(HAVE_LIBREADLINE, 1, [ ])
 
 elif test "$PHP_LIBEDIT" != "no"; then
@@ -94,7 +92,11 @@ elif test "$PHP_LIBEDIT" != "no"; then
     -L$READLINE_DIR/$PHP_LIBDIR 
   ])
 
+  AC_DEFINE(HAVE_LIBEDIT, 1, [ ])
+fi
+
+if test "$PHP_READLINE" != "no" || test "$PHP_LIBEDIT" != "no"; then
+  AC_CHECK_FUNCS([rl_completion_matches])
   PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)
   PHP_SUBST(READLINE_SHARED_LIBADD)
-  AC_DEFINE(HAVE_LIBEDIT, 1, [ ])
 fi
index f86fdfcd0771701a818b0ae8dc265070216eee2a..0888cdd61aeb2f8cc7eabbe5140434c684a2553f 100644 (file)
 
 #if HAVE_LIBREADLINE || HAVE_LIBEDIT
 
+#ifndef HAVE_RL_COMPLETION_MATCHES
+#define rl_completion_matches completion_matches
+#endif
+
 #include <readline/readline.h>
 #ifndef HAVE_LIBEDIT
 #include <readline/history.h>
@@ -421,7 +425,7 @@ static char **_readline_completion_cb(const char *text, int start, int end)
        if (call_user_function(CG(function_table), NULL, _readline_completion, &_readline_array, 3, params TSRMLS_CC) == SUCCESS) {
                if (Z_TYPE(_readline_array) == IS_ARRAY) {
                        if (zend_hash_num_elements(Z_ARRVAL(_readline_array))) {
-                               matches = completion_matches(text,_readline_command_generator);
+                               matches = rl_completion_matches(text,_readline_command_generator);
                        } else {
                                matches = malloc(sizeof(char *) * 2);
                                matches[0] = strdup("");
index 301a1534a2b48cfd5653b15a9be338ac37b19a9a..97dde30702992b8f5881d21526eb7dd2f85d2889 100644 (file)
 
 #if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
 
+#ifndef HAVE_RL_COMPLETION_MATCHES
+#define rl_completion_matches completion_matches
+#endif
+
 #include "php_globals.h"
 #include "php_variables.h"
 #include "zend_hash.h"