Re: Converting tab-complete.c's else-if chain to a switch

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jacob Champion <jacob.champion@enterprisedb.com>
Cc: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>, Thomas Munro <thomas.munro@gmail.com>, Andres Freund <andres@anarazel.de>, pgsql-hackers@lists.postgresql.org
Date: 2024-10-10T21:04:46Z
Lists: pgsql-hackers
Jacob Champion <jacob.champion@enterprisedb.com> writes:
> Meson's coverage generation is unhappy with the new hardcoded #line
> references emitted by gen_tabcomplete.pl:
>     genhtml: ERROR: cannot read
> /home/jacob/src/postgres/worktree-oauth/build-dev/tab-complete.in.c
> I've attached a potential fix which references $ARGV[0] instead, but
> it's not really tested beyond "works for me".

I tried this with meson and with a VPATH configure build, and it
seemed to work all right for both.  (The coverage report in a
VPATH configure build is kind of wonky, but that was true before,
and I'm not sure that anyone wants to put effort into making it
cleaner.)  Pushed.

			regards, tom lane



Commits

  1. Don't hard-code the input file name in gen_tabcomplete.pl's output.

  2. Avoid possible segfault in psql's tab completion.

  3. Convert tab-complete's long else-if chain to a switch statement.

  4. Prepare tab-complete.c for preprocessing.

  5. Invent "MatchAnyN" option for tab-complete.c's Matches/MatchesCS.