summaryrefslogtreecommitdiffstats
path: root/libjava/java/io
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-12 01:08:18 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-12 01:08:18 +0000
commit7c5c57d2f73b5776b88f94ce76c04a1125ecef32 (patch)
treecc393aee173f98e9c7405d011a5edcfacc64ebb6 /libjava/java/io
parent4779f708f3cc2c46be0a530fcb0188d4b55d8496 (diff)
downloadppe42-gcc-7c5c57d2f73b5776b88f94ce76c04a1125ecef32.tar.gz
ppe42-gcc-7c5c57d2f73b5776b88f94ce76c04a1125ecef32.zip
* 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
Diffstat (limited to 'libjava/java/io')
-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 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
OpenPOWER on IntegriCloud