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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martijn Dekker <martijn@xxxxxxxx> 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 <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux