Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
activescott committed Dec 4, 2016
1 parent 80e50f3 commit 3dd97c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/LessIO/Strategies/Win32/Win32FileSystemStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ public override void CreateDirectory(Path path)
int lengthRoot = path.PathRoot.Length;

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

0 comments on commit 3dd97c3

Please sign in to comment.