summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2005-11-28 16:51:16 +0000
committerfoobar <sniper@php.net>2005-11-28 16:51:16 +0000
commit26b8b65c1858e97e4fe1e9cb49e5f69890982779 (patch)
tree40ed9920e0443c626fee1001abc5c062262fc6d7 /ext/readline
parent14594953d2de208530f9a6f56fbaf51fbaa9a16c (diff)
downloadphp-git-26b8b65c1858e97e4fe1e9cb49e5f69890982779.tar.gz
MFH: - Fixed bug #35409 (undefined reference to 'rl_completion_matches').
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/config.m48
-rw-r--r--ext/readline/readline.c6
2 files changed, 10 insertions, 4 deletions
diff --git a/ext/readline/config.m4 b/ext/readline/config.m4
index 2ec104c3d4..58d21765c1 100644
--- a/ext/readline/config.m4
+++ b/ext/readline/config.m4
@@ -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
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index f86fdfcd07..0888cdd61a 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -29,6 +29,10 @@
#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("");