Skip to content

Commit 3dd97c3

Browse files
committed
1 parent 80e50f3 commit 3dd97c3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/LessIO/Strategies/Win32/Win32FileSystemStrategy.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ public override void CreateDirectory(Path path)
8989
int lengthRoot = path.PathRoot.Length;
9090

9191
var firstNonRootPathIndex = pathString.IndexOfAny(Path.DirectorySeperatorChars, lengthRoot);
92+
if (firstNonRootPathIndex == -1)
93+
{
94+
// this is a directory directly off of the root (because no, non-root directory seperators exist)
95+
firstNonRootPathIndex = pathString.Length - 1; // set it to the whole path so that the loop below will create the root dir
96+
}
9297
var i = firstNonRootPathIndex;
9398
while (i < pathString.Length)
9499
{

0 commit comments

Comments
 (0)