diff --git a/source/dub/internal/io/mockfs.d b/source/dub/internal/io/mockfs.d index 8afa2c93a..1cb60132b 100644 --- a/source/dub/internal/io/mockfs.d +++ b/source/dub/internal/io/mockfs.d @@ -459,11 +459,8 @@ public class FSEntry /// Returns: The `path` of this FSEntry public NativePath path () const scope { - version (Windows) enum RootPath = "T:\\"; - else enum RootPath = "/"; - if (this.parent is null) - return NativePath(RootPath); + return this.name.length ? NativePath(this.name) : NativePath("/"); assert(!NativePath(this.name).absolute, this.name); auto thisPath = this.parent.path ~ this.name; thisPath.endsWithSlash = (this.attributes.type == Type.Directory);