8305312: Enhanced path handling
Reviewed-by: rhalade, alanb
This commit is contained in:
parent
be70bc1c58
commit
889c663a0e
@ -75,10 +75,6 @@ class UnixUriUtils {
|
||||
int pos = 0;
|
||||
while (pos < len) {
|
||||
char c = p.charAt(pos++);
|
||||
if ((c == '/') && (pos < len) && (p.charAt(pos) == '/')) {
|
||||
// skip redundant slashes
|
||||
continue;
|
||||
}
|
||||
byte b;
|
||||
if (c == '%') {
|
||||
assert (pos+2) <= len;
|
||||
@ -92,6 +88,10 @@ class UnixUriUtils {
|
||||
throw new IllegalArgumentException("Bad escape");
|
||||
b = (byte)c;
|
||||
}
|
||||
if (b == '/' && rlen > 0 && result[rlen-1] == '/') {
|
||||
// skip redundant slashes
|
||||
continue;
|
||||
}
|
||||
result[rlen++] = b;
|
||||
}
|
||||
if (rlen != result.length)
|
||||
|
Loading…
x
Reference in New Issue
Block a user