Re: [PATCH v2] fix build on systems without memrchr(3)

Herbert Xu <[email protected]>
Newsgroups org.kernel.vger.dash
Message-ID <[email protected]>
Martijn Dekker <[email protected]> wrote:
> 
> Op 22-06-2024 om 15:25 schreef Martijn Dekker:
>> memrchr(3) is non-standard, and has been ported from glibc to FreeBSD, NetSBD 
>> and OpenBSD, but not to macOS, at least as of 12.7.5. So we need a test for 
>> it. As far as I can tell, *name is a zero-terminated C string, so it should 
>> work to use strrchr(3) as a fallback.
> 
> Reading the code more closely, that's nonsense, because 'p' does not point to 
> the end of the string if metacharacters are found.
> 
> Guess the best we can do is provide a simple local fallback implementation of 
> memrchr(3). Patch v2 attached.

Patch applied.  Thanks.
-- 
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.