postgresql/src/include/libpq
Peter Eisentraut 8b3e2c622a Fix pg_isblank()
There was a pg_isblank() function that claimed to be a replacement for
the standard isblank() function, which was thought to be "not very
portable yet".  We can now assume that it's portable (it's in C99).

But pg_isblank() actually diverged from the standard isblank() by also
accepting '\r', while the standard one only accepts space and tab.
This was added to support parsing pg_hba.conf under Windows.  But the
hba parsing code now works completely differently and already handles
line endings before we get to pg_isblank().  The other user of
pg_isblank() is for ident protocol message parsing, which also handles
'\r' separately.  So this behavior is now obsolete and confusing.

To improve clarity, I separated those concerns.  The ident parsing now
gets its own function that hardcodes the whitespace characters
mentioned by the relevant RFC.  pg_isblank() is now static in hba.c
and is a wrapper around the standard isblank(), with some extra logic
to ensure robust treatment of non-ASCII characters.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/170308e6-a7a3-4484-87b2-f960bb564afa%40eisentraut.org
2025-11-28 08:33:07 +01:00
..
auth.h Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
be-fsstubs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
be-gssapi-common.h Move GSSAPI includes into its own header 2025-03-26 15:31:46 +01:00
crypt.h Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
hba.h Fix pg_isblank() 2025-11-28 08:33:07 +01:00
ifaddr.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
libpq-be-fe-helpers.h Run pgindent on the changes of the previous patch. 2025-07-25 16:36:44 -04:00
libpq-be-fe.h Create infrastructure to reliably prevent leakage of PGresults. 2025-07-25 16:30:00 -04:00
libpq-be.h Add local-address escape "%L" to log_line_prefix. 2025-04-07 11:06:05 -04:00
libpq-fs.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
libpq.h Generate GUC tables from .dat file 2025-09-03 09:45:17 +02:00
oauth.h Harmonize function parameter names for Postgres 18. 2025-04-12 12:07:36 -04:00
pg-gssapi.h Move GSSAPI includes into its own header 2025-03-26 15:31:46 +01:00
pqcomm.h Reorganize pqcomm.h a bit 2025-11-24 10:01:30 -08:00
pqformat.h Replace pg_restrict by standard restrict 2025-10-29 07:52:58 +01:00
pqmq.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pqsignal.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
protocol.h Use PqMsg_* macros in fe-protocol3.c. 2025-08-25 11:08:26 -05:00
sasl.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
scram.h Update copyright for 2025 2025-01-01 11:21:55 -05:00