On Fri, 8 Sep 2023 01:07:17 GMT, Brian Burkhalter <b...@openjdk.org> wrote:

>> In the Windows implementation of java.io.File.getCanonicalPath, strip any 
>> long path or UNC prefix before canonicalizing the remainder of the pathname.
>
> Brian Burkhalter has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   8287843: Handle "\\?\UNC"; add bad paths to test

For `\\\?\`, the normalization will drop the trailing slash so the path string 
is actually `\\\?`. I that that case is okay.

For input such as `\\\?\\foo` and `\\\?\\C:`, the stripping results in a 
relative path, `foo` and `C:` in these examples, which means the canonicalize 
code is starting with a relative path. We have to be careful here as the path 
has always been make absolute before attempting to canonicalize.

For `\\\?\\UNC` and `\\\?\\UNC\`, the stripping means these will be treated as 
`\`, which is the root directory of the current volume. I know these will fail 
with "The network path was not path" but I can't help thinking it would 
reject/throw early.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15603#issuecomment-1712457295

Reply via email to