Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, steven(dot)winfield(at)cantabcapital(dot)com
Subject: Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes
Date: 2019-12-13 15:38:05
Message-ID: 20191213153805.GA2808@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 2019-Dec-13, Tom Lane wrote:

> I wrote:
> >> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:

> >>> #ifdef HAVE_RL_FILENAME_COMPLETION_FUNCTION
> >>> #define filename_completion_function rl_filename_completion_function
> >>> #else
> >>> /* decl missing in some header files, but function exists anyway */
> >>> extern char *filename_completion_function();
> >>> #endif

> Looking closer at this, the "extern" could be got rid of, I think.
> prairiedog's readline header does have that extern, so it's hard to
> believe anybody is still using libedit versions that don't declare it.

Agreed.

> A possible further change is to switch the code over to calling
> "rl_filename_completion_function", and then invert the sense of
> this logic, like
>
> /*
> * Ancient versions of libedit provide filename_completion_function()
> * instead of rl_filename_completion_function().
> */
> #ifndef HAVE_RL_FILENAME_COMPLETION_FUNCTION
> #define rl_filename_completion_function filename_completion_function
> #endif
>
> This would make it easier to compare our code to the readline
> documentation, so maybe it's helpful ... or maybe it's just
> churn. Thoughts?

+1, I think that's clearer.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-12-13 16:18:09 Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes
Previous Message Kamil Jońca 2019-12-13 15:05:34 Re: Random crashes - segmentation fault

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-12-13 15:43:39 Re: Remove configure --disable-float4-byval and --disable-float8-byval
Previous Message Alvaro Herrera 2019-12-13 15:35:38 Re: recovery_min_apply_delay in archive recovery causes assertion failure in latch