* 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
+2003-09-11 Tom Tromey <tromey@redhat.com>
+
+ * 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 "/".
+
2003-09-11 Michael Koch <konqueror@gmx.de>
* acconfig.h: Removed most items.
// Found ".." component, lop off last part from existing
// buffer.
--out_idx;
- while (out_idx > 0 && buf[out_idx] != '/')
+ while (out_idx > 0 && buf2[out_idx] != '/')
--out_idx;
// Can't go up past "/".
if (out_idx == 0)
out_idx += len;
}
}
- buf[out_idx] = '\0';
+
+ buf2[out_idx] = '\0';
}
// FIXME: what encoding to assume for file names? This affects many
// 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)
{