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:
Tom Tromey 2003-09-12 01:08:18 +00:00 committed by Tom Tromey
parent e4bee82f89
commit 030612a110
3 changed files with 14 additions and 2 deletions

View file

@ -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)
{