summaryrefslogtreecommitdiff
path: root/src/bin/psql/tab-complete.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-06-11 22:12:48 +0000
committerBruce Momjian <bruce@momjian.us>2001-06-11 22:12:48 +0000
commit92f450652c88fb3f00a3da7883d2a3fa22a1bf3d (patch)
treebc55c039d5cd470b54bf09b7beea44d4a1b71f24 /src/bin/psql/tab-complete.c
parent8af0ea9dc137d39f44d40c7b5246f24f06c3a03d (diff)
The attached patch enables PostgreSQL CVS to build cleanly under Cygwin
when built against readline 4.2. Specifically, it handles the deprecation of filename_completion_function() with preference for rl_filename_completion_function() Although, I was motivated by Cygwin support, IMO this patch is appropriate for all platforms. To quote from the readline source: #if 0 /* Backwards compatibility (compat.c). These will go away sometime. */ ... extern READLINE_EXPORT(char, *filename_completion_function) ... #endif Note that this patch is modeled after the one by Peter Eisentraut for completion_matches(): http://www.ca.postgresql.org/~petere/readline42.html I tested this patch under the following environments: Cygwin with readline 4.1 Cygwin with readline 4.2 Linux with readline 2.2.1 Linux with readline 4.2 and it behaved as expected. Jason Tishler
Diffstat (limited to 'src/bin/psql/tab-complete.c')
-rw-r--r--src/bin/psql/tab-complete.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index dd323162dda..e8ed3c668ae 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.32 2001/05/08 21:06:43 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.33 2001/06/11 22:12:48 momjian Exp $
*/
/*----------------------------------------------------------------------
@@ -60,7 +60,9 @@
#include "common.h"
#include "settings.h"
-extern char *filename_completion_function();
+#ifdef HAVE_RL_FILENAME_COMPLETION_FUNCTION
+#define filename_completion_function rl_filename_completion_function
+#endif
#ifdef HAVE_RL_COMPLETION_MATCHES
#define completion_matches(x, y) rl_completion_matches((x), ((rl_compentry_func_t *)(y)))