[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cp-tools-discuss] Kaffe Patch
From: |
Julian Scheid |
Subject: |
[Cp-tools-discuss] Kaffe Patch |
Date: |
Fri, 26 Nov 2004 20:25:51 +0100 |
User-agent: |
Mozilla Thunderbird 0.8 (X11/20040913) |
This patch fixes the problem with ../ paths in jar: URIs and a NPE in
java.net.URL. It should work for other classpath-based distros as well.
Julian
diff -ur kaffe/libraries/javalib/gnu/java/net/protocol/jar/Connection.java
kaffe-patched/libraries/javalib/gnu/java/net/protocol/jar/Connection.java
--- kaffe/libraries/javalib/gnu/java/net/protocol/jar/Connection.java
2004-07-26 23:13:52.000000000 +0200
+++ kaffe-patched/libraries/javalib/gnu/java/net/protocol/jar/Connection.java
2004-11-26 20:23:12.000000000 +0100
@@ -140,6 +140,18 @@
if (entry_name != null
&& !entry_name.equals (""))
{
+ int ndx;
+ while ((ndx = entry_name.indexOf(File.separatorChar + ".." +
File.separatorChar)) >= 0) {
+ int ndx2 = entry_name.lastIndexOf(File.separatorChar, ndx - 1);
+ if (ndx2 >= 0) {
+ entry_name = entry_name.substring(0, ndx2)
+ + entry_name.substring(ndx + 3);
+ }
+ else {
+ break;
+ }
+ }
+
jar_entry = (JarEntry) jar_file.getEntry (entry_name);
if(jar_entry == null)
diff -ur kaffe/libraries/javalib/java/net/URL.java
kaffe-patched/libraries/javalib/java/net/URL.java
--- kaffe/libraries/javalib/java/net/URL.java 2004-10-16 15:31:00.000000000
+0200
+++ kaffe-patched/libraries/javalib/java/net/URL.java 2004-11-26
20:23:32.000000000 +0100
@@ -321,7 +321,7 @@
*/
public URL(String spec) throws MalformedURLException
{
- this((URL) null, spec, (URLStreamHandler) null);
+ this((URL) null, spec != null ? spec : "", (URLStreamHandler) null);
}
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Cp-tools-discuss] Kaffe Patch,
Julian Scheid <=