Re: replace strtok()
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Ranier Vilela <ranier.vf@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-06-22T15:48:21Z
Lists: pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes: > On 18.06.24 13:43, Ranier Vilela wrote: >> I found another implementation of strsep, it seems lighter to me. >> I will attach it for consideration, however, I have not done any testing. > Yeah, surely there are many possible implementations. I'm thinking, > since we already took other str*() functions from OpenBSD, it makes > sense to do this here as well, so we have only one source to deal with. Why not use strpbrk? That's equally thread-safe, it's been there since C89, and it doesn't have the problem that you can't find out which of the delimiter characters was found. regards, tom lane
Commits
-
Fix memory leaks from incorrect strsep() uses
- 4b652692e979 18.0 landed
-
Fix strsep() use for SCRAM secrets parsing
- 24a36f91e32d 18.0 landed
-
Replace remaining strtok() with strtok_r()
- 65504b747f3c 18.0 landed
-
Windows replacement for strtok_r()
- 4d130b28727c 18.0 landed
-
Replace some strtok() with strsep()
- 5d2e1cc117b3 18.0 landed
-
Add port/ replacement for strsep()
- 683be87fbba0 18.0 landed