From e22d631956dd5fdc5e3772c1a854524ac6d34347 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 25 Dec 2018 13:03:00 +0100 Subject: [PATCH] fix issue 19510 - random and spurious error about a missing NOLOGO.d file --- src/dmd/link.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dmd/link.d b/src/dmd/link.d index 86f6fc7ba9e6..4a0f9c3d22ef 100644 --- a/src/dmd/link.d +++ b/src/dmd/link.d @@ -1052,9 +1052,10 @@ version (Windows) // try lld-link.exe alongside dmd.exe char[MAX_PATH + 1] dmdpath = void; - if (GetModuleFileNameA(null, dmdpath.ptr, dmdpath.length) <= MAX_PATH) + const len = GetModuleFileNameA(null, dmdpath.ptr, dmdpath.length); + if (len <= MAX_PATH) { - auto lldpath = FileName.replaceName(dmdpath, "lld-link.exe"); + auto lldpath = FileName.replaceName(dmdpath[0 .. len], "lld-link.exe"); if (FileName.exists(lldpath)) return lldpath.ptr; }