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

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: psql: when tab-completing, use quotes on file names that need th
Date: 2012-02-28 04:15:59
Message-ID: E1S2ETn-0003ib-N0@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2012-02-28 10:44:10 pgsql: Add const qualifiers where they are accidentally cast away
Previous Message Tom Lane 2012-02-27 22:49:08 Re: pgsql: ALTER TABLE: skip FK validation when it's safe to do so