public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Nick Clifton" <nickc@redhat.com>, "Martin Storsjö" <martin@martin.st>
Cc: binutils@sourceware.org
Subject: Re: [PATCH v2] ld: Make library member file suffix comparisons case insensitive when cross compiling too
Date: Tue, 23 Aug 2022 16:23:59 +0200	[thread overview]
Message-ID: <58cd3a02-08bf-972d-c4e0-f39622d849c0@suse.com> (raw)
In-Reply-To: <b88420f8-6851-18de-f56f-3753e318467b@redhat.com>

On 23.08.2022 16:01, Nick Clifton via Binutils wrote:
>> +/* Hardcoded case insensitive comparison. filename_cmp is insensitive
>> + * when running on Windows, but when cross compiling to Windows, we
>> + * also want similar comparisons to be case insensitive. */
>> +static int stricmp (const char *s1, const char *s2)
>> +{
>> +  for (;;)
>> +    {
>> +      int c1 = TOLOWER (*s1++);
>> +      int c2 = TOLOWER (*s2++);
>> +
>> +      if (c1 != c2)
>> +        return (c1 - c2);
>> +
>> +      if (c1 == '\0')
>> +        return 0;
>> +    }
>> +}
> 
> The implementation of filename_cmp() in libiberty also treats forward
> slashes and backward slashes as the same, on DOS based filesystems.
> Shouldn't this be carried over to stricmp() as well ?

Well, the function is used on filename extensions (.dll and alike) only,
so that shouldn't be necessary. But I think the function would want to
have a name expressing this very limited purpose, and the comment ahead
of it would also want to call this out.

Jan

  parent reply	other threads:[~2022-08-23 14:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 13:06 Martin Storsjö
2022-08-23 14:01 ` Nick Clifton
2022-08-23 14:19   ` Martin Storsjö
2022-08-23 14:23   ` Jan Beulich [this message]
2022-08-23 21:11     ` [PATCH v3] ld: Make archive member file extension " Martin Storsjö
2022-08-24  6:38       ` Jan Beulich
2022-08-24  8:23         ` [PATCH v4] " Martin Storsjö
2022-08-24  9:48           ` Nick Clifton
2022-08-24 10:03             ` Martin Storsjö
2022-08-24 10:04               ` [PATCH v5] " Martin Storsjö
2022-08-24 10:29                 ` Jan Beulich
2022-08-24 10:46                   ` Martin Storsjö
2022-08-24 10:46                     ` Martin Storsjö
2022-08-24 10:47                     ` [PATCH v6] " Martin Storsjö
2022-08-24 11:17                       ` Jan Beulich
2022-08-24 12:25                         ` [PATCH v7] " Martin Storsjö
2022-08-24 12:39                           ` Jan Beulich
2022-08-24 12:56                           ` Nick Clifton
2022-08-24 20:23                             ` Martin Storsjö
2022-08-25  6:53             ` [PATCH v4] " Martin Storsjö

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=58cd3a02-08bf-972d-c4e0-f39622d849c0@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=martin@martin.st \
    --cc=nickc@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).