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:
@@ -164,7 +164,7 @@ java::io::File::getCanonicalPath (void)
|
||||
// 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)
|
||||
@@ -179,7 +179,8 @@ java::io::File::getCanonicalPath (void)
|
||||
out_idx += len;
|
||||
}
|
||||
}
|
||||
buf[out_idx] = '\0';
|
||||
|
||||
buf2[out_idx] = '\0';
|
||||
}
|
||||
|
||||
// FIXME: what encoding to assume for file names? This affects many
|
||||
|
||||
Reference in New Issue
Block a user