[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: URL parsing fix

Kaffe CVS cvs-commits at kaffe.org
Thu Jan 13 00:14:52 PST 2005


PatchSet 5848 
Date: 2005/01/13 08:05:02
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: URL parsing fix

2005-01-13  Dalibor Topic  <robilad at kaffe.org>

Resynced with GNU Classpath.

2005-01-11  Michael Koch  <konqueror at gmx.de>

* java/net/URL.java (URL): Handle specs like
/redir?http://domain2.com/index.html which start with a slash.

Members: 
	ChangeLog:1.3392->1.3393 
	libraries/javalib/java/net/URL.java:1.51->1.52 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3392 kaffe/ChangeLog:1.3393
--- kaffe/ChangeLog:1.3392	Thu Jan 13 08:02:12 2005
+++ kaffe/ChangeLog	Thu Jan 13 08:05:02 2005
@@ -1,6 +1,15 @@
 2005-01-13  Dalibor Topic  <robilad at kaffe.org>
 
 	Resynced with GNU Classpath.
+	
+	2005-01-11  Michael Koch  <konqueror at gmx.de>
+
+	* java/net/URL.java (URL): Handle specs like
+	"/redir?http://domain2.com/index.html" which start with a slash.
+	
+2005-01-13  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
 
 	2005-01-11  Graydon Hoare  <graydon at redhat.com>
 
Index: kaffe/libraries/javalib/java/net/URL.java
diff -u kaffe/libraries/javalib/java/net/URL.java:1.51 kaffe/libraries/javalib/java/net/URL.java:1.52
--- kaffe/libraries/javalib/java/net/URL.java:1.51	Sat Dec  4 12:13:59 2004
+++ kaffe/libraries/javalib/java/net/URL.java	Thu Jan 13 08:05:06 2005
@@ -392,13 +392,14 @@
     // 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 @@
 	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();



More information about the kaffe mailing list