Tab completion of double quoted identifiers broken

Started by Dean Rasheedalmost 14 years ago2 messages
#1Dean Rasheed
dean.a.rasheed@gmail.com

Hi,

I just spotted that tab completion of double quoted identifiers seems
to be broken in 9.2devel. For example things like this which worked in
9.1 no longer work:

UPDATE "foo bar" <tab>

It looks like the problem is in get_previous_words() here:

if (buf[start] == '"')
inquotes = !inquotes;
else if (!inquotes)
{
... test for start of word ...

which fails to account for the fact that the double quote itself might
be the start of the word. I think the solution is just to remove the
"else":

if (buf[start] == '"')
inquotes = !inquotes;
if (!inquotes)
{
... test for start of word ...

to allow it to find a word-breaking character immediately before the
double quote.

Regards,
Dean

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dean Rasheed (#1)
Re: Tab completion of double quoted identifiers broken

Dean Rasheed <dean.a.rasheed@gmail.com> writes:

I just spotted that tab completion of double quoted identifiers seems
to be broken in 9.2devel.

Yeah, looks like I broke it :-( --- I think I missed the fact that the
last check with WORD_BREAKS was looking at the previous character not
the current one, so I thought adding the "else" was a safe optimization.
Patch applied, thanks for the report!

regards, tom lane