I just checked in the following patch, which was approved by tromey.
2005-09-15 Anthony Green <[EMAIL PROTECTED]>
PR libgcj/20198
* java/net/URLClassLoader.java (FileURLLoader.getResource): File
resources should all have canonicalized names.
Index: java/net/URLClassLoader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URLClassLoader.java,v
retrieving revision 1.36
diff -u -r1.36 URLClassLoader.java
--- java/net/URLClassLoader.java 9 Sep 2005 21:42:58 -0000 1.36
+++ java/net/URLClassLoader.java 16 Sep 2005 22:48:33 -0000
@@ -535,9 +535,16 @@
/** get resource with the name "name" in the file url */
Resource getResource(String name)
{
- File file = new File(dir, name);
- if (file.exists() && !file.isDirectory())
- return new FileResource(this, name, file);
+ try
+ {
+ File file = new File(dir, name).getCanonicalFile();
+ if (file.exists() && !file.isDirectory())
+ return new FileResource(this, file.path(), file);
+ }
+ catch (IOException e)
+ {
+ // Fall through...
+ }
return null;
}
}
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches