Subject: Re: [PATCH] compat: add memrchr()

From: Johannes Sixt <[email-masked]>
Date: Fri, 15 Oct 2010 11:35:53 +0200

Am 10/15/2010 10:56, schrieb Erik Faye-Lund:
> On Fri, Oct 15, 2010 at 7:17 AM, Jonathan Nieder <[email-masked]> wrote:
>> Reimplement another handy convenience function from glibc.  memrchr()
>> searches from the end of a memory area for a particular character.  It
>> is similar to strrchr() but takes a length argument and is
>> binary-safe.
>>
>> The whole-directory rename detection patch could use this to find the
>> last directory separator in a (possibly truncated) pathname.
>>
> 
> Are you sure this would work on Windows where both '/' and '\' are
> valid directory separators?

I'm sure this would be used only on paths that were constructed from index
or repository contents; there, the directory separator is '/' by definition.

-- Hannes