git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Christopher Ertl <Christopher.Ertl@microsoft.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Windows absolute drive path detection incomplete
Date: Thu, 8 Aug 2019 12:50:32 -0400	[thread overview]
Message-ID: <CAPig+cSuj6xWjYuQtuiuNQwroqO8sEh4iAGgLqQVOLQr8CMpDQ@mail.gmail.com> (raw)
In-Reply-To: <DB7PR83MB0268816EF2F435EF791272C197D70@DB7PR83MB0268.EURPRD83.prod.outlook.com>

On Thu, Aug 8, 2019 at 12:45 PM Christopher Ertl
<Christopher.Ertl@microsoft.com> wrote:
> So I'm proposing to remove the check for the drive letter being alpha in `has_dos_drive_prefix` macro:
>
> #define has_dos_drive_prefix(path) \
>         ( (path)[1] == ':' ? 2 : 0)

Nit: This isn't safe and will access memory beyond end-of-string if
path is zero-length. Perhaps something like this would be better:

    #define has_dos_drive_prefix(path) \
        (*(path) && (path)[1] == ':' ? 2 : 0)

  reply	other threads:[~2019-08-08 16:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 16:44 Windows absolute drive path detection incomplete Christopher Ertl
2019-08-08 16:50 ` Eric Sunshine [this message]
2019-08-08 16:58   ` Christopher Ertl
2019-08-09  0:22 ` brian m. carlson

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAPig+cSuj6xWjYuQtuiuNQwroqO8sEh4iAGgLqQVOLQr8CMpDQ@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=Christopher.Ertl@microsoft.com \
    --cc=git@vger.kernel.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).