1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

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
This commit is contained in:
Alvaro Herrera
2012-02-28 01:06:29 -03:00
parent cb3a7c2b95
commit 41e3c94cac
3 changed files with 128 additions and 2 deletions

View File

@ -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 */