All of lore.kernel.org
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [RFH] renaming strcmp/strncmp-icase
Date: Mon, 08 Sep 2014 23:36:15 +0200	[thread overview]
Message-ID: <540E214F.5010708@web.de> (raw)
In-Reply-To: <xmqqmwaalzb4.fsf@gitster.dls.corp.google.com>

Am 08.09.2014 um 20:52 schrieb Junio C Hamano:
> 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é

      parent reply	other threads:[~2014-09-08 21:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 18:52 [RFH] renaming strcmp/strncmp-icase Junio C Hamano
2014-09-08 19:31 ` Torsten Bögershausen
2014-09-08 19:56   ` Junio C Hamano
2014-09-08 21:36 ` René Scharfe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=540E214F.5010708@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.