From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Replace some strtok() with strsep() |
Date: | 2024-07-22 13:52:39 |
Message-ID: | E1sVtSx-000iLM-EG@gemulon.postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Replace some strtok() with strsep()
strtok() considers adjacent delimiters to be one delimiter, which is
arguably the wrong behavior in some cases. Replace with strsep(),
which has the right behavior: Adjacent delimiters create an empty
token.
Affected by this are parsing of:
- Stored SCRAM secrets
("SCRAM-SHA-256$<iterations>:<salt>$<storedkey>:<serverkey>")
- ICU collation attributes
("und(at)colStrength=primary;colCaseLevel=yes") for ICU older than
version 54
- PG_COLORS environment variable
("error=01;31:warning=01;35:note=01;36:locus=01")
- pg_regress command-line options with comma-separated list arguments
(--dbname, --create-role) (currently only used pg_regress_ecpg)
Reviewed-by: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Reviewed-by: David Steele <david(at)pgmasters(dot)net>
Discussion: https://www.postgresql.org/message-id/flat/79692bf9-17d3-41e6-b9c9-fc8c3944222a(at)eisentraut(dot)org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/5d2e1cc117b38db6bb5dc2e9ae9115304571ac70
Modified Files
--------------
src/backend/libpq/auth-scram.c | 11 +++++------
src/backend/utils/adt/pg_locale.c | 3 ++-
src/common/logging.c | 4 +++-
src/test/regress/pg_regress.c | 5 ++---
4 files changed, 12 insertions(+), 11 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2024-07-22 14:19:26 | pgsql: Add missing call to ConditionVariableCancelSleep(). |
Previous Message | Alvaro Herrera | 2024-07-22 10:56:59 | pgsql: postgres_fdw: Split out the query_cancel test to its own file |