aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2005-01-11 20:40:10 +0000
committerMichael Koch <konqueror@gmx.de>2005-01-11 20:40:10 +0000
commite15ed2ef1cb280a2edf3835d2899e829cea52f3c (patch)
tree8b0ea21d1fd9877fd3c90d1666a32e3349859570 /libjava
parent4e770e3f6dc1bd6d8c3b059624a25522a44b1be2 (diff)
2005-01-11 Michael Koch <konqueror@gmx.de>
PR libgcj/13972 * java/net/URL.java (URL): Handle specs like "/redir?http://domain2.com/index.html" which start with a slash. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@93197 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/java/net/URL.java7
2 files changed, 9 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 3c962937681..918f99f087d 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,11 @@
2005-01-11 Michael Koch <konqueror@gmx.de>
+ PR libgcj/13972
+ * java/net/URL.java (URL): Handle specs like
+ "/redir?http://domain2.com/index.html" which start with a slash.
+
+2005-01-11 Michael Koch <konqueror@gmx.de>
+
PR libgcj/14012, PR libgcj/14013, PR libgcj/15157, PR libgcj/15509
* gnu/java/net/BASE64.java,
gnu/java/net/EmptyX509TrustManager.java,
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index 4353662908a..96f97991280 100644
--- a/libjava/java/net/URL.java
+++ b/libjava/java/net/URL.java
@@ -392,13 +392,14 @@ public final class URL implements Serializable
// right after the "://". The second colon is for an optional port value
// and implies that the host from the context is used if available.
int colon;
+ int slash = spec.indexOf('/');
if ((colon = spec.indexOf("://", 1)) > 0
+ && ((colon < slash || slash < 0))
&& ! spec.regionMatches(colon, "://:", 0, 4))
context = null;
- int slash;
if ((colon = spec.indexOf(':')) > 0
- && (colon < (slash = spec.indexOf('/')) || slash < 0))
+ && (colon < slash || slash < 0))
{
// Protocol specified in spec string.
protocol = spec.substring(0, colon).toLowerCase();
@@ -429,8 +430,6 @@ public final class URL implements Serializable
authority = context.authority;
}
else // Protocol NOT specified in spec. and no context available.
-
-
throw new MalformedURLException("Absolute URL required with null context");
protocol = protocol.trim();