Skip to content

Commit 07e4824

Browse files
committed
Fixup
1 parent 28621e2 commit 07e4824

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

source/dub/internal/io/mockfs.d

+3-9
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,12 @@ public class FSEntry
348348
}
349349

350350
/// Create the root of the filesystem, only usable from this module
351-
package(dub) this (char drive = 0)
351+
package(dub) this (string name = null)
352352
{
353353
import std.datetime.date;
354354
SysTime DefaultTime = SysTime(DateTime(2020, 01, 01));
355355

356-
if (drive) {
357-
assert(drive >= 'A' && drive <= 'Z');
358-
this.name = drive ~ `:\`;
359-
}
356+
this.name = name;
360357
this.attributes.type = Type.Directory;
361358
this.attributes.access = DefaultTime;
362359
this.attributes.modification = DefaultTime;
@@ -451,11 +448,8 @@ public class FSEntry
451448
/// Returns: The `path` of this FSEntry
452449
public NativePath path () const scope
453450
{
454-
version (Windows) enum RootPath = "T:\\";
455-
else enum RootPath = "/";
456-
457451
if (this.parent is null)
458-
return NativePath(RootPath);
452+
return this.name.length ? NativePath(this.name) : NativePath("/");
459453
assert(!NativePath(this.name).absolute, this.name);
460454
auto thisPath = this.parent.path ~ this.name;
461455
thisPath.endsWithSlash = (this.attributes.type == Type.Directory);

0 commit comments

Comments
 (0)