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

Re: Windows absolute drive path detection incomplete

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 8, 2019, 16:50 UTC
Message-ID
<CAPig+cSuj6xWjYuQtuiuNQwroqO8sEh4iAGgLqQVOLQr8CMpDQ@mail.gmail.com>
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)
Previous: Christopher ErtlNext: Christopher Ertl
Message 2 of 4 in “Windows absolute drive path detection incomplete”
  1. Christopher ErtlAug 8, 2019
  2. Eric SunshineAug 8, 2019
  3. Christopher ErtlAug 8, 2019
  4. brian m. carlsonAug 9, 2019

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.