Re: Making tab-complete.c easier to maintain

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Making tab-complete.c easier to maintain
Дата
Msg-id CAB7nPqStYKa+P87cQbFPqM5PWbhtUa=fDGdSZrHAZU8r45SStQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Making tab-complete.c easier to maintain  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Dec 30, 2015 at 1:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> This is because of the use of strncmp instead of plain strcmp
> in most of the backslash matching rules, eg the above case is
> covered by
>
>         else if (strncmp(prev_wd, "\\df", strlen("\\df")) == 0)

Ah, OK. The length of the name and not the pattern is used in
word_matches, but we had better use something based on the pattern
shape. And the current logic for backslash commands uses the length of
the pattern, and not the word for its checks.

> I was envisioning that we'd want to convert this to something like
>
>         else if (TailMatchesCS1("\\df*"))

That's a better macro name...
-- 
Michael



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: exposing pg_controldata and pg_config as functions
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Making tab-complete.c easier to maintain