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

Re: [RFH] renaming strcmp/strncmp-icase

From
René Scharfe <l.s.r@web.de>
Date
Sep 8, 2014, 21:36 UTC
Message-ID
<540E214F.5010708@web.de>
In-Reply-To
<xmqqmwaalzb4.fsf@gitster.dls.corp.google.com>
Am 08.09.2014 um 20:52 schrieb Junio C Hamano:
Show 18 quoted lines
> There are these two functions in dir.c that has only a handful of
> callers outside:
>
>      int strcmp_icase(const char *a, const char *b);
>      int strncmp_icase(const char *a, const char *b, size_t count);
>
> How many of you would think these are about comparing two strings in
> a case-insensitive way?
>
> If you raised your hand (like I did), you were wrong.  These do
> comparison case-insensitively only on a case-insensitive filesystem,
> and hence calling it makes sense only for pathnames you grabbed out
> of the filesystem via readdir() (or the user gave us, intending to
> name paths).
>
> To avoid confusion, I think they should be renamed to stress the
> fact that these are about comparing *PATHS*.  As I always say, I am
> bad at naming things and good suggestions are appreciated.
> pathnamecmp()/pathnamencmp() perhaps?
"namen" looks strange to me.  How about pathcmp/pathncmp?
René
Previous: Junio C Hamano
Message 4 of 4 in “[RFH] renaming strcmp/strncmp-icase”
  1. Junio C HamanoSep 8, 2014
  2. Torsten BögershausenSep 8, 2014
  3. Junio C HamanoSep 8, 2014
  4. René ScharfeSep 8, 2014

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.