www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20810] New: Freshly built DMD fails to read config file

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 puremagic.com
          Reporter: andrej.mitrovich 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 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. --
May 08 2020