git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] compat: add memrchr()

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Oct 15, 2010, 09:35 UTC
Message-ID
<4CB82079.4030402@viscovery.net>
In-Reply-To
<AANLkTi=MbSeeUcPpPt_yLyeTv10pNzHqGUu3ihXf8jb+@mail.gmail.com>
Am 10/15/2010 10:56, schrieb Erik Faye-Lund:
Show 12 quoted lines
> On Fri, Oct 15, 2010 at 7:17 AM, Jonathan Nieder <jrnieder@gmail.com> 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
Previous: Erik Faye-Lund
Message 17 of 17 in “Detection of directory renames”
  1. 0/5 Detection of directory renamesYann Dirson, Oct 14, 2010
  2. 1/5 Introduce bulk-move detection in diffcore.Yann Dirson, Oct 14, 2010
  3. 2/5 Add testcases for the --detect-bulk-moves diffcore flag.Yann Dirson, Oct 14, 2010
  4. 3/5 [RFC] Handle the simpler case of a subdir invalidating bulk move.Yann Dirson, Oct 14, 2010
  5. 4/5 [RFC] Consider all parents of a file as candidates for bulk rename.Yann Dirson, Oct 14, 2010
  6. 5/5 [WIP] Allow hiding renames of individual files involved in a directory rename.Yann Dirson, Oct 14, 2010
  7. [RFC] Consider all parents of a file as candidates for bulk rename.Yann Dirson, Oct 17, 2010
  8. compat: add memrchr()Jonathan Nieder, Oct 15, 2010
  9. Ævar Arnfjörð BjarmasonOct 15, 2010
  10. Jonathan NiederOct 15, 2010
  11. Ævar Arnfjörð BjarmasonOct 15, 2010
  12. Junio C HamanoOct 15, 2010
  13. Johannes SixtOct 15, 2010
  14. Ludvig StrigeusOct 15, 2010
  15. compat: add memrchr()Jonathan Nieder, Oct 15, 2010
  16. Erik Faye-LundOct 15, 2010
  17. Johannes SixtOct 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.