psql: when tab-completing, use quotes on file names that need them

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: 41e3c94cac0e68257126b2d264dc5e877e892490
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2012-02-28T04:06:29Z
Releases: 9.2.0
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

Files

PathChange+/−
src/bin/psql/stringutils.c modified +69 −0
src/bin/psql/stringutils.h modified +3 −0
src/bin/psql/tab-complete.c modified +56 −2