summaryrefslogtreecommitdiff
path: root/src/bin/psql/tab-complete.c
diff options
context:
space:
mode:
authorPeter Eisentraut2000-03-05 13:30:20 +0000
committerPeter Eisentraut2000-03-05 13:30:20 +0000
commit8de482a8479eef200e184ce308bf3f40eac3215b (patch)
treed987e8242b1fe545b0bcbd986cb518a157540a6d /src/bin/psql/tab-complete.c
parent3c71ed7e72680ad5cde765978b98bd34bb58089a (diff)
Added configure test for readline's filename_completion_function
Completed psql's \? help
Diffstat (limited to 'src/bin/psql/tab-complete.c')
-rw-r--r--src/bin/psql/tab-complete.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 9edfc6b6da8..54561cb3778 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.14 2000/02/20 14:28:20 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.15 2000/03/05 13:30:19 petere Exp $
*/
/*-----------
@@ -50,6 +50,10 @@
#include "common.h"
#include "settings.h"
+#if defined(HAVE_FILENAME_COMPLETION_FUNCTION) && !defined(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
+char * filename_completion_function (char *, int);
+#endif
+
#define BUF_SIZE 2048
#define ERROR_QUERY_TOO_LONG /* empty */
@@ -532,7 +536,15 @@ char ** psql_completion(char *text, int start, int end)
strcmp(prev_wd, "\\s")==0 ||
strcmp(prev_wd, "\\w")==0 || strcmp(prev_wd, "\\write")==0
) {
+#ifdef HAVE_FILENAME_COMPLETION_FUNCTION
matches = completion_matches(text, filename_completion_function);
+#else
+ /*
+ * This will probably have the same effect, but you never know what
+ * the heck some readline incarnation out there is going to do.
+ */
+ matches = NULL;
+#endif
}