pgsql: Rewrite tab completion's previous-word fetching for more sanity.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Rewrite tab completion's previous-word fetching for more sanity.
Date: 2011-10-20 19:44:31
Message-ID: E1RGyXX-0002rw-Cg@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Rewrite tab completion's previous-word fetching for more sanity.

Make it return empty strings when there are no more words to the left of
the current position, instead of sometimes returning NULL and other times
returning copies of the leftmost word. Also, fetch the words in one scan,
rather than the previous wasteful approach of starting from scratch for
each word. Make the code a bit harder to break when someone decides we
need more words of context, too. (There was actually a memory leak here,
because whoever added prev6_wd neglected to free it.)

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/dce92c6d6abe302c58fd4e4221efed54913aefdb

Modified Files
--------------
src/bin/psql/tab-complete.c | 142 +++++++++++++++++++++++--------------------
1 files changed, 76 insertions(+), 66 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-10-20 23:44:32 pgsql: Simplify and improve ProcessStandbyHSFeedbackMessage logic.
Previous Message Robert Haas 2011-10-20 04:07:53 pgsql: Fix get_object_namespace() not to think extensions are "in" a sc