diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2012-02-28 01:06:29 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2012-02-28 01:06:29 -0300 |
commit | 41e3c94cac0e68257126b2d264dc5e877e892490 (patch) | |
tree | d581501cc8819ea933329d71a3373109a25db794 /src/bin/psql/stringutils.h | |
parent | cb3a7c2b95a28e57c56562d48d2a3aa5eeb7fa29 (diff) |
psql: when tab-completing, use quotes on file names that need them
psql backslash commands that deal with file or directory names require
quotes around those that have spaces, single quotes, or backslashes.
However, tab-completing such names does not provide said quotes, and is
thus almost useless with them.
This patch fixes the problem by having a wrapper function around
rl_filename_completion_function that dequotes on input and quotes on
output. This eases dealing with such names.
Author: Noah Misch
Diffstat (limited to 'src/bin/psql/stringutils.h')
-rw-r--r-- | src/bin/psql/stringutils.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bin/psql/stringutils.h b/src/bin/psql/stringutils.h index c7c5f3877d9..c64fc584585 100644 --- a/src/bin/psql/stringutils.h +++ b/src/bin/psql/stringutils.h @@ -19,4 +19,7 @@ extern char *strtokx(const char *s, bool del_quotes, int encoding); +extern char *quote_if_needed(const char *source, const char *entails_quote, + char quote, char escape, int encoding); + #endif /* STRINGUTILS_H */ |