@@ -144,10 +144,10 @@ public static bool SamePathOrUnder( string path1, string path2 )
144144
145145 // if lengths are the same, check for equality
146146 if ( length1 == length2 )
147- return string . Compare ( path1 , path2 , OS . IsWindows ) == 0 ;
147+ return string . Compare ( path1 , path2 , RunningOnWindows ) == 0 ;
148148
149149 // path 2 is longer than path 1: see if initial parts match
150- if ( string . Compare ( path1 , path2 . Substring ( 0 , length1 ) , OS . IsWindows ) != 0 )
150+ if ( string . Compare ( path1 , path2 . Substring ( 0 , length1 ) , RunningOnWindows ) != 0 )
151151 return false ;
152152
153153 // must match through or up to a directory separator boundary
@@ -174,11 +174,13 @@ public static string Combine(string path1, params string[] morePaths)
174174 /// <exception cref="ArgumentNullException"><paramref name="path"/></exception>
175175 public static bool IsFullyQualifiedPath ( string path )
176176 {
177- return OS . IsWindows
177+ return RunningOnWindows
178178 ? IsFullyQualifiedWindowsPath ( path )
179179 : IsFullyQualifiedUnixPath ( path ) ;
180180 }
181181
182+ private static bool RunningOnWindows => DirectorySeparatorChar == '\\ ' ;
183+
182184 /// <summary>
183185 /// Returns a value that indicates whether the specified file path is fully qualified or not on Windows operating systems.
184186 /// </summary>
@@ -275,7 +277,7 @@ private static string[] SplitPath(string path)
275277
276278 private static bool PathsEqual ( string path1 , string path2 )
277279 {
278- if ( OS . IsWindows )
280+ if ( RunningOnWindows )
279281 return path1 . ToLower ( ) . Equals ( path2 . ToLower ( ) ) ;
280282 else
281283 return path1 . Equals ( path2 ) ;
0 commit comments