[Issue 20810] New: Freshly built DMD fails to read config file

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 8 17:04:53 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20810

          Issue ID: 20810
           Summary: Freshly built DMD fails to read config file
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: andrej.mitrovich at gmail.com

$ C:\dev\dmd\src>rdmd build.d -v
..\generated\windows\release\64\dmd.exe

It tries to get the canonical name of this path:
C:\dev\dmd\generated\windows\release\64\sc.ini

But it fails at this assertion:
> core.exception.AssertError at dmd\root\filename.d(1011): Assertion failure

This assert fails:
assert(length == fullPathLength);

I've read the docs here:
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamew

It seems on the second call the count will actually not include the null
character, specifically this note from MSDN:

> Note  Although the return value in this case is a length that includes the terminating null character, the return value on success does not include the terminating null character in the count.

I'll submit a PR.

--


More information about the Digitalmars-d-bugs mailing list