www.digitalmars.com         C & C++   DMDScript  

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


          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

It tries to get the canonical name of this path:

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