[armedbear-cvs] r11597 - trunk/abcl/src/org/armedbear/lisp

Alessio Stalla astalla at common-lisp.net
Tue Jan 27 20:20:33 UTC 2009


Author: astalla
Date: Tue Jan 27 20:20:31 2009
New Revision: 11597

Log:
Fixed URL decoding bug in loadCompiledFunction using 
java.net.URLDecoder.


Modified:
   trunk/abcl/src/org/armedbear/lisp/Lisp.java

Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Lisp.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Lisp.java	Tue Jan 27 20:20:31 2009
@@ -40,6 +40,7 @@
 import java.lang.reflect.Constructor;
 import java.math.BigInteger;
 import java.net.URL;
+import java.net.URLDecoder;
 import java.util.Hashtable;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
@@ -999,24 +1000,8 @@
                             // "/C:/Documents%20and%20Settings/peter/Desktop/j.jar"
                             if (zipFileName.length() > 0 && zipFileName.charAt(0) == '/')
                               zipFileName = zipFileName.substring(1);
-                            // "C:/Documents%20and%20Settings/peter/Desktop/j.jar"
-                            int i = zipFileName.indexOf("%20");
-                            if (i >= 0)
-                              {
-                                int begin = 0;
-                                FastStringBuffer sb = new FastStringBuffer();
-                                while (i >= 0)
-                                  {
-                                    sb.append(zipFileName.substring(begin, i));
-                                    sb.append(' ');
-                                    begin = i + 3;
-                                    i = zipFileName.indexOf("%20", begin);
-                                  }
-                                sb.append(zipFileName.substring(begin));
-                                zipFileName = sb.toString();
-                                // "C:/Documents and Settings/peter/Desktop/j.jar"
-                              }
-                          }
+			  }
+			zipFileName = URLDecoder.decode(zipFileName, "UTF-8");
                         ZipFile zipFile = new ZipFile(zipFileName);
                         try
                           {




More information about the armedbear-cvs mailing list