We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37fbcf6 commit 1d38084Copy full SHA for 1d38084
src/java.base/unix/classes/sun/nio/fs/UnixUriUtils.java
@@ -75,10 +75,6 @@ static Path fromUri(UnixFileSystem fs, URI uri) {
75
int pos = 0;
76
while (pos < len) {
77
char c = p.charAt(pos++);
78
- if ((c == '/') && (pos < len) && (p.charAt(pos) == '/')) {
79
- // skip redundant slashes
80
- continue;
81
- }
82
byte b;
83
if (c == '%') {
84
assert (pos+2) <= len;
@@ -92,6 +88,10 @@ static Path fromUri(UnixFileSystem fs, URI uri) {
92
88
throw new IllegalArgumentException("Bad escape");
93
89
b = (byte)c;
94
90
}
91
+ if (b == '/' && rlen > 0 && result[rlen-1] == '/') {
+ // skip redundant slashes
+ continue;
+ }
95
result[rlen++] = b;
96
97
if (rlen != result.length)
0 commit comments