aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2004-07-11 16:48:29 +0000
committerMark Wielaard <mark@gcc.gnu.org>2004-07-11 16:48:29 +0000
commiteeb32988362bb6942c88f173c2062aa23ec7684e (patch)
tree2488e5c9c3e7c042bf56eb97dcf600aa98c7aa6f
parent1e38f159295f7d09b6dc6452a75c0b069ecd550a (diff)
downloadgcc-eeb32988362bb6942c88f173c2062aa23ec7684e.zip
gcc-eeb32988362bb6942c88f173c2062aa23ec7684e.tar.gz
gcc-eeb32988362bb6942c88f173c2062aa23ec7684e.tar.bz2
Reported by Roman Kennke <roman@ontographics.com> (bug #9331)
Reported by Roman Kennke <roman@ontographics.com> (bug #9331) * java/net/URLStreamHandler.java (parseURL): When url file part doesn't contain a '/' just ignore context. From-SVN: r84518
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/java/net/URLStreamHandler.java8
2 files changed, 11 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 01952d6..c7f5dec 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-11 Mark Wielaard <mark@klomp.org>
+
+ Reported by Roman Kennke <roman@ontographics.com> (bug #9331)
+ * java/net/URLStreamHandler.java (parseURL): When url file part
+ doesn't contain a '/' just ignore context.
+
2004-07-11 Ulrich Weigand <uweigand@de.ibm.com>
* include/s390-signal.c (SIGNAL_HANDLER): Use SIGINFO-style prototype.
diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java
index 5fef7ea..aca6261 100644
--- a/libjava/java/net/URLStreamHandler.java
+++ b/libjava/java/net/URLStreamHandler.java
@@ -208,9 +208,11 @@ public abstract class URLStreamHandler
{
// Context is available, but only override it if there is a new file.
int lastSlash = file.lastIndexOf('/');
-
- file =
- file.substring(0, lastSlash) + '/' + spec.substring(start, end);
+ if (lastSlash < 0)
+ file = spec.substring(start, end);
+ else
+ file = (file.substring(0, lastSlash)
+ + '/' + spec.substring(start, end));
if (url.getProtocol().equals("file"))
{