pgsql: psql: when tab-completing, use quotes on file names that need th - Mailing list pgsql-committers

From Alvaro Herrera
Subject pgsql: psql: when tab-completing, use quotes on file names that need th
Date
Msg-id E1S2ETn-0003ib-N0@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/41e3c94cac0e68257126b2d264dc5e877e892490

Modified Files
--------------
src/bin/psql/stringutils.c  |   69 +++++++++++++++++++++++++++++++++++++++++++
src/bin/psql/stringutils.h  |    3 ++
src/bin/psql/tab-complete.c |   58 ++++++++++++++++++++++++++++++++++-
3 files changed, 128 insertions(+), 2 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: ALTER TABLE: skip FK validation when it's safe to do so
Next
From: Peter Eisentraut
Date:
Subject: pgsql: Add const qualifiers where they are accidentally cast away