Commit 7cc0d6ae authored by Tom Lane's avatar Tom Lane

Fix tab-complete so it works with old versions of readline that don't

have the rl_completion_append_character variable.  The tab completion
behavior doesn't seem to be quite perfect in that situation, but it's
better than failing to build at all...
parent e33f550b
......@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Team
*
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.7 2000/01/18 23:30:24 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.8 2000/01/21 23:32:36 tgl Exp $
*/
/*-----------
......@@ -532,7 +532,9 @@ char ** psql_completion(char *text, int start, int end)
attempts filename completion, and that's usually no good. */
if (matches == NULL) {
COMPLETE_WITH_CONST("");
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
rl_completion_append_character = '\0';
#endif
}
......
This diff is collapsed.
......@@ -840,11 +840,16 @@ AC_CHECK_FUNC(rint,
AC_DEFINE(HAVE_RINT),
AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB))
dnl Some old versions of libreadline don't have rl_completion_append_character
AC_EGREP_HEADER(rl_completion_append_character, readline.h,
AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER),
[AC_EGREP_HEADER(rl_completion_append_character, readline/readline.h,
AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER))])
AC_SUBST(HAVE_RL_COMPLETION_APPEND_CHARACTER)
dnl Check for GNU style long options support (getopt_long)
AC_CHECK_FUNCS(getopt_long)
AC_MSG_CHECKING(for finite() macro or function)
AC_TRY_LINK([#include <math.h>],
[int dummy=finite(1.0);],
......
......@@ -454,6 +454,9 @@ extern void srandom(unsigned int seed);
/* Set to 1 if you have libhistory.a */
#undef HAVE_LIBHISTORY
/* Set to 1 if your libreadline defines rl_completion_append_character */
#undef HAVE_RL_COMPLETION_APPEND_CHARACTER
/* Set to 1 if you have getopt_long() (GNU long options) */
#undef HAVE_GETOPT_LONG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment