Index: config.m4 =================================================================== RCS file: /repository/php-src/ext/readline/config.m4,v retrieving revision 1.25.2.1 diff -u -p -d -r1.25.2.1 config.m4 --- config.m4 18 Nov 2005 15:07:39 -0000 1.25.2.1 +++ config.m4 19 Nov 2005 11:54:43 -0000 @@ -50,6 +50,20 @@ if test "$PHP_READLINE" != "no"; then -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS ]) + PHP_CHECK_LIBRARY(readline, rl_completion_matches, + [ + AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1, [ ]) + ], [ + PHP_CHECK_LIBRARY(readline, completion_matches, + [], [ + AC_MSG_ERROR(could not find a suitable equivalent of completion_matches function) + ], [ + -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS + ]) + ], [ + -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS + ]) + PHP_CHECK_LIBRARY(history, add_history, [ PHP_ADD_LIBRARY_WITH_PATH(history, $READLINE_DIR/$PHP_LIBDIR, READLINE_SHARED_LIBADD) Index: readline.c =================================================================== RCS file: /repository/php-src/ext/readline/readline.c,v retrieving revision 1.42 diff -u -p -d -r1.42 readline.c --- readline.c 3 Aug 2005 14:07:42 -0000 1.42 +++ readline.c 19 Nov 2005 11:54:43 -0000 @@ -421,7 +421,11 @@ static char **_readline_completion_cb(co 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); +#ifdef HAVE_RL_COMPLETION_MATCHES + matches = rl_completion_matches(text, _readline_command_generator); +#else + matches = completion_matches(text, _readline_command_generator); +#endif } else { matches = malloc(sizeof(char *) * 2); matches[0] = strdup("");