Skip to content

Commit 4f39dfa

Browse files
Aleksei VoitylovRealCLanger
authored andcommitted
8298667: Improved path handling
Reviewed-by: mbalao Backport-of: 900abc284669d1aadeac8026ad618c9f1dc553a6
1 parent b5dda54 commit 4f39dfa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/java.base/unix/classes/sun/nio/fs/UnixUriUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ static Path fromUri(UnixFileSystem fs, URI uri) {
7575
int pos = 0;
7676
while (pos < len) {
7777
char c = p.charAt(pos++);
78+
if ((c == '/') && (pos < len) && (p.charAt(pos) == '/')) {
79+
// skip redundant slashes
80+
continue;
81+
}
7882
byte b;
7983
if (c == '%') {
8084
assert (pos+2) <= len;

0 commit comments

Comments
 (0)