From 7c5c57d2f73b5776b88f94ce76c04a1125ecef32 Mon Sep 17 00:00:00 2001 From: tromey Date: Fri, 12 Sep 2003 01:08:18 +0000 Subject: * 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 "/". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71327 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/io/natFilePosix.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libjava/java/io') diff --git a/libjava/java/io/natFilePosix.cc b/libjava/java/io/natFilePosix.cc index a1eb1c74b80..580b5955ac0 100644 --- a/libjava/java/io/natFilePosix.cc +++ b/libjava/java/io/natFilePosix.cc @@ -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 -- cgit v1.2.3