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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user