diff --git a/source/dub/internal/vibecompat/inet/path.d b/source/dub/internal/vibecompat/inet/path.d index 8c685b5..f21e7c8 100644 --- a/source/dub/internal/vibecompat/inet/path.d +++ b/source/dub/internal/vibecompat/inet/path.d @@ -101,7 +101,7 @@ version(Windows) { assert(!absolute, "Empty absolute path detected."); return m_endsWithSlash ? ".\\" : "."; - } else return absolute ? "/" : "./"; + } else return absolute ? "/" : m_endsWithSlash ? "./" : "."; } Appender!string ret; @@ -331,6 +331,21 @@ unittest { + Path p; + assert(p.toNativeString() == "."); + p.endsWithSlash = true; + version(Windows) assert(p.toNativeString() == ".\\"); + else assert(p.toNativeString() == "./"); + + p = Path("test/"); + version(Windows) assert(p.toNativeString() == "test\\"); + else assert(p.toNativeString() == "test/"); + p.endsWithSlash = false; + assert(p.toNativeString() == "test"); +} + +unittest +{ { auto unc = "\\\\server\\share\\path"; auto uncp = Path(unc);