aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-01-23 18:20:57 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-01-23 18:20:57 -0500
commitc32704441d47cc1cbb36367a429814511edb6ffd (patch)
treed2944f25fefa4dea8bf39b6d06586c1b243fdce5 /src
parent9a3a75cb81d3b060b8e76001d04c78ab4ce0dcef (diff)
downloadpostgresql-c32704441d47cc1cbb36367a429814511edb6ffd.tar.gz
postgresql-c32704441d47cc1cbb36367a429814511edb6ffd.zip
Add configure probe for rl_completion_suppress_quote.
I had supposed that all versions of Readline that have filename quoting hooks also have the rl_completion_suppress_quote variable. But it seems OpenBSD managed to find a version someplace that does not, so we'll have to expend a separate configure probe for that. (Light testing suggests that this version also lacks the bugs that make it necessary to frob that variable. Hooray!) Per buildfarm.
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/tab-complete.c7
-rw-r--r--src/include/pg_config.h.in4
-rw-r--r--src/tools/msvc/Solution.pm1
3 files changed, 9 insertions, 3 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 08634882432..dc03fbde131 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -4468,11 +4468,10 @@ complete_from_files(const char *text, int state)
* anyway. Set rl_completion_suppress_quote to prevent that. If we do
* get to quote_file_name(), we'll clear this again. (Yes, this seems
* like it's working around Readline bugs.)
- *
- * (For now, we assume that rl_completion_suppress_quote exists if the
- * filename quoting hooks do.)
*/
+#ifdef HAVE_RL_COMPLETION_SUPPRESS_QUOTE
rl_completion_suppress_quote = 1;
+#endif
/* If user typed a quote, force quoting (never remove user's quote) */
if (*text == '\'')
@@ -4842,7 +4841,9 @@ quote_file_name(char *fname, int match_type, char *quote_pointer)
* on its own accord. (This covers some additional cases beyond those
* dealt with above.)
*/
+#ifdef HAVE_RL_COMPLETION_SUPPRESS_QUOTE
rl_completion_suppress_quote = 0;
+#endif
/*
* If user typed a leading quote character other than single quote (i.e.,
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 983d94e3fe7..6f485f73cd1 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -485,6 +485,10 @@
/* Define to 1 if you have the `rl_completion_matches' function. */
#undef HAVE_RL_COMPLETION_MATCHES
+/* Define to 1 if you have the global variable 'rl_completion_suppress_quote'.
+ */
+#undef HAVE_RL_COMPLETION_SUPPRESS_QUOTE
+
/* Define to 1 if you have the `rl_filename_completion_function' function. */
#undef HAVE_RL_FILENAME_COMPLETION_FUNCTION
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index cc4e2383181..90de0583203 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -332,6 +332,7 @@ sub GenerateFiles
HAVE_RINT => 1,
HAVE_RL_COMPLETION_APPEND_CHARACTER => undef,
HAVE_RL_COMPLETION_MATCHES => undef,
+ HAVE_RL_COMPLETION_SUPPRESS_QUOTE => undef,
HAVE_RL_FILENAME_COMPLETION_FUNCTION => undef,
HAVE_RL_FILENAME_QUOTE_CHARACTERS => undef,
HAVE_RL_FILENAME_QUOTING_FUNCTION => undef,