diff options
author | Tom Tromey <tromey@redhat.com> | 2003-09-12 01:08:18 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-09-12 01:08:18 +0000 |
commit | 030612a110957f96af1496e1cbf0be58a1cd1359 (patch) | |
tree | cc393aee173f98e9c7405d011a5edcfacc64ebb6 /libjava/java/io/natFilePosix.cc | |
parent | e4bee82f89b273c15b0b364aa9cf22bb121673b4 (diff) | |
download | gcc-030612a110957f96af1496e1cbf0be58a1cd1359.zip gcc-030612a110957f96af1496e1cbf0be58a1cd1359.tar.gz gcc-030612a110957f96af1496e1cbf0be58a1cd1359.tar.bz2 |
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
Diffstat (limited to 'libjava/java/io/natFilePosix.cc')
-rw-r--r-- | libjava/java/io/natFilePosix.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libjava/java/io/natFilePosix.cc b/libjava/java/io/natFilePosix.cc index a1eb1c7..580b595 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 |