DIfferent Directory Separator for linux (#16936)
authorAnirudh Agnihotry <anirudhagnihotry098@gmail.com>
Wed, 14 Mar 2018 21:33:35 +0000 (14:33 -0700)
committerGitHub <noreply@github.com>
Wed, 14 Mar 2018 21:33:35 +0000 (14:33 -0700)
src/mscorlib/shared/System/IO/PathInternal.cs

index c5cce00..00a7092 100644 (file)
@@ -123,7 +123,7 @@ namespace System.IO
             // We treat "\.." , "\." and "\\" as a relative segment. We want to collapse the first separator past the root presuming
             // the root actually ends in a separator. Otherwise the first segment for RemoveRelativeSegments
             // in cases like "\\?\C:\.\" and "\\?\C:\..\", the first segment after the root will be ".\" and "..\" which is not considered as a relative segment and hence not be removed.
-            if (path[skip - 1] == '\\')
+            if (PathInternal.IsDirectorySeparator(path[skip - 1]))
                 skip--;
 
             Span<char> initialBuffer = stackalloc char[260 /* PathInternal.MaxShortPath */];