aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/io/natFilePosix.cc
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2003-09-12 01:08:18 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-09-12 01:08:18 +0000
commit030612a110957f96af1496e1cbf0be58a1cd1359 (patch)
treecc393aee173f98e9c7405d011a5edcfacc64ebb6 /libjava/java/io/natFilePosix.cc
parente4bee82f89b273c15b0b364aa9cf22bb121673b4 (diff)
downloadgcc-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.cc5
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