diff options
author | Tom Tromey <tromey@redhat.com> | 2003-09-12 01:08:18 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-09-12 01:08:18 +0000 |
commit | 030612a110957f96af1496e1cbf0be58a1cd1359 (patch) | |
tree | cc393aee173f98e9c7405d011a5edcfacc64ebb6 /libjava/java/net/URLStreamHandler.java | |
parent | e4bee82f89b273c15b0b364aa9cf22bb121673b4 (diff) | |
download | gcc-030612a110957f96af1496e1cbf0be58a1cd1359.zip gcc-030612a110957f96af1496e1cbf0be58a1cd1359.tar.gz gcc-030612a110957f96af1496e1cbf0be58a1cd1359.tar.bz2 |
URLStreamHandler.java (parseURL): If original file ends with "/", so must canonical result.
* java/net/URLStreamHandler.java (parseURL): If original file
ends with "/", so must canonical result.
* java/io/natFilePosix.cc (getCanonicalPath): Clean up snafus
with nul-termination and finding previous "/".
From-SVN: r71327
Diffstat (limited to 'libjava/java/net/URLStreamHandler.java')
-rw-r--r-- | libjava/java/net/URLStreamHandler.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java index 93a8ab2..61b466c 100644 --- a/libjava/java/net/URLStreamHandler.java +++ b/libjava/java/net/URLStreamHandler.java @@ -196,7 +196,11 @@ public abstract class URLStreamHandler // need to canonicalise the file path. try { + boolean endsWithSlash = file.charAt(file.length() - 1) == '/'; file = new File (file).getCanonicalPath (); + if (endsWithSlash + && file.charAt(file.length() - 1) != '/') + file += '/'; } catch (IOException e) { |