This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: URLStreamHandler bugfix from GNU Classpath


Hi,

This merges a bug fix from GNU Classpath for URLStreamHandler.

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.

Committed.

Cheers,

Mark
Index: java/net/URLStreamHandler.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URLStreamHandler.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- java/net/URLStreamHandler.java	23 Apr 2004 21:13:20 -0000	1.28
+++ java/net/URLStreamHandler.java	1 Jul 2004 23:46:16 -0000	1.29
@@ -204,9 +204,11 @@
       {
 	// 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"))
 	  {

Attachment: signature.asc
Description: This is a digitally signed message part


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]