Skip to content

Commit 2d9f032

Browse files
author
Brian Burkhalter
committed
8360028: (fs) Path.relativize throws StringIndexOutOfBoundsException (win)
Reviewed-by: alanb
1 parent 25ed36f commit 2d9f032

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/java.base/windows/classes/sun/nio/fs/WindowsLinkSupport.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -356,7 +356,9 @@ private static String readLinkImpl(WindowsPath path, long handle)
356356
if (target.isEmpty()) {
357357
throw new IOException("Symbolic link target is invalid");
358358
}
359-
return target;
359+
360+
// return normalized path string
361+
return WindowsPathParser.parse(target).path();
360362
}
361363
}
362364

0 commit comments

Comments
 (0)