@@ -50,16 +50,7 @@ public static string GetFullPath(string path)
50
50
if ( path . Contains ( '\0 ' ) )
51
51
throw new ArgumentException ( SR . Argument_InvalidPathChars , nameof ( path ) ) ;
52
52
53
- if ( PathInternal . IsExtended ( path . AsSpan ( ) ) )
54
- {
55
- // \\?\ paths are considered normalized by definition. Windows doesn't normalize \\?\
56
- // paths and neither should we. Even if we wanted to GetFullPathName does not work
57
- // properly with device paths. If one wants to pass a \\?\ path through normalization
58
- // one can chop off the prefix, pass it to GetFullPath and add it again.
59
- return path ;
60
- }
61
-
62
- return PathHelper . Normalize ( path ) ;
53
+ return GetFullyQualifiedPath ( path ) ;
63
54
}
64
55
65
56
public static string GetFullPath ( string path , string basePath )
@@ -77,7 +68,7 @@ public static string GetFullPath(string path, string basePath)
77
68
throw new ArgumentException ( SR . Argument_InvalidPathChars ) ;
78
69
79
70
if ( IsPathFullyQualified ( path ) )
80
- return GetFullPath ( path ) ;
71
+ return GetFullyQualifiedPath ( path ) ;
81
72
82
73
if ( PathInternal . IsEffectivelyEmpty ( path . AsSpan ( ) ) )
83
74
return basePath ;
@@ -129,7 +120,21 @@ public static string GetFullPath(string path, string basePath)
129
120
130
121
return PathInternal . IsDevice ( combinedPath . AsSpan ( ) )
131
122
? PathInternal . RemoveRelativeSegments ( combinedPath , PathInternal . GetRootLength ( combinedPath . AsSpan ( ) ) )
132
- : GetFullPath ( combinedPath ) ;
123
+ : GetFullyQualifiedPath ( combinedPath ) ;
124
+ }
125
+
126
+ internal static string GetFullyQualifiedPath ( string path )
127
+ {
128
+ if ( PathInternal . IsExtended ( path . AsSpan ( ) ) )
129
+ {
130
+ // \\?\ paths are considered normalized by definition. Windows doesn't normalize \\?\
131
+ // paths and neither should we. Even if we wanted to GetFullPathName does not work
132
+ // properly with device paths. If one wants to pass a \\?\ path through normalization
133
+ // one can chop off the prefix, pass it to GetFullPath and add it again.
134
+ return path ;
135
+ }
136
+
137
+ return PathHelper . Normalize ( path ) ;
133
138
}
134
139
135
140
public static string GetTempPath ( )
0 commit comments