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
This commit is contained in:
parent
e4bee82f89
commit
030612a110
3 changed files with 14 additions and 2 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue