From: Eli Zaretskii <eliz@gnu.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: dj@redhat.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org
Subject: Re: [RFA/libiberty] Enhance FILENAME_CMP for Windows filesystems
Date: Sat, 31 Mar 2007 11:57:00 -0000 [thread overview]
Message-ID: <ubqi97hiq.fsf@gnu.org> (raw)
In-Reply-To: <20070328202443.GD3956@adacore.com> (message from Joel Brobecker on Wed, 28 Mar 2007 13:24:43 -0700)
> Date: Wed, 28 Mar 2007 13:24:43 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org
>
> Here is a revised version of the patch that should address both
> comments (copyright notice, and lack of documentation):
Sorry for chiming in only now, but I have a few minor comments:
> @deftypefn Extension int filename_cmp (const char *@var{s1}, const char *@var{s2})
>
> Return zero if the two paths @var{s1} and @var{s2} are equivalent.
The GNU project frowns on using `path' to mean a file name. `Path' is
reserved to $PATH-like lists of directories. In this context, I
suggest to use `file name' instead. (There's one more instance of
using `path' in the documentation of this function.)
> If not equivalent, the returned value is similar to what strcmp would
"strcmp" should be in @code{}, as it is a C symbol.
> This function does not normalize path names. As a result, this function
^
Two blanks, please.
> int
> filename_cmp (const char *s1, const char *s2)
> {
> #ifndef HAVE_DOS_BASED_FILE_SYSTEM
> return strcmp(s1, s2);
While I realize that the original FILENAME_CMP macro did the same, as
long as we are trying to do better, wouldn't it be nice if this
function also collapsed multiple consecutive slashes or backslashes?
> for (;;)
> {
> int c1 = tolower (*s1);
> int c2 = tolower (*s2);
Are we sure that strncasecmp's behavior wrt to locales is identical to
that of tolower's? If not, the above will introduce a bug in
non-English locales.
next prev parent reply other threads:[~2007-03-31 11:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-28 19:17 Joel Brobecker
2007-03-28 19:31 ` DJ Delorie
2007-03-28 19:36 ` Joel Brobecker
2007-03-28 20:23 ` Joel Brobecker
2007-03-28 20:44 ` DJ Delorie
2007-03-29 20:56 ` Joel Brobecker
2007-03-29 21:02 ` Joel Brobecker
2007-03-29 21:03 ` Daniel Jacobowitz
2007-03-29 21:07 ` DJ Delorie
2007-03-29 21:44 ` Joel Brobecker
2007-03-31 11:57 ` Eli Zaretskii [this message]
2007-03-31 22:40 ` Christopher Faylor
2007-04-01 3:04 ` Eli Zaretskii
2007-04-02 7:01 ` Joel Brobecker
2007-04-01 20:58 ` Andreas Schwab
2007-04-02 6:34 ` Joel Brobecker
2007-04-02 11:21 ` Andreas Schwab
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=ubqi97hiq.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=brobecker@adacore.com \
--cc=dj@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb-patches@sourceware.org \
/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