]> granicus.if.org Git - postgresql/commit
psql: when tab-completing, use quotes on file names that need them
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 28 Feb 2012 04:06:29 +0000 (01:06 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 28 Feb 2012 04:06:29 +0000 (01:06 -0300)
commit41e3c94cac0e68257126b2d264dc5e877e892490
treed581501cc8819ea933329d71a3373109a25db794
parentcb3a7c2b95a28e57c56562d48d2a3aa5eeb7fa29
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
src/bin/psql/stringutils.c
src/bin/psql/stringutils.h
src/bin/psql/tab-complete.c