Index: src/org/armedbear/lisp/Load.java
===================================================================
--- src/org/armedbear/lisp/Load.java	(révision 12053)
+++ src/org/armedbear/lisp/Load.java	(copie de travail)
@@ -103,48 +103,74 @@
 					boolean returnLastResult)
         throws ConditionThrowable
     {
-	String dir = null;
+        InputStream in = null;
+        String zipFileName = null;
+        String zipEntryName = null;
+        String dir = null;
+
         if (!Utilities.isFilenameAbsolute(filename)) {
 	    dir =
                 coerceToPathname(Symbol.DEFAULT_PATHNAME_DEFAULTS.symbolValue()).getNamestring();
         }
 
+        // attempt to load from a jar file
+        if (filename.startsWith("jar:file:")) {
+            String s = new String(filename);
+            s = s.substring(9);
+            int index = s.lastIndexOf('!');
+            if (index >= 0)
+            {
+                zipFileName = s.substring(0, index);
+                zipEntryName = s.substring(index + 1);
+                if (zipEntryName.length() > 0 && zipEntryName.charAt(0) == '/')
+                    zipEntryName = zipEntryName.substring(1);
+                if (Utilities.isPlatformWindows) {
+                    if (zipFileName.length() > 0 && zipFileName.charAt(0) == '/')
+                        zipFileName = zipFileName.substring(1);
+                }
+            }
+        }
+
 	File file = findLoadableFile(filename, dir);
-        if (file == null) {
+        if (null == file && null == zipFileName) {
             if (ifDoesNotExist)
-                return error(new FileError("File not found: " + filename,
-                                            pathname));
+                return error(new FileError("File not found: " + filename, pathname));
             else
                 return NIL;
         }
+        if (checkZipFile(file)) {
+            // filename = file.getPath();
+            zipFileName = file.getPath();
+            zipEntryName = file.getName();
+        }
+        
+        String truename = filename;
+        ZipFile zipfile = null;
 
-	filename = file.getPath();
-        ZipFile zipfile = null;
-        if (checkZipFile(file))
-        {
+        if (zipFileName != null) {
             try {
-                zipfile = ZipCache.getZip(file.getPath());
+                zipfile = ZipCache.getZip(zipFileName);
             }
             catch (Throwable t) {
-                // Fall through.
+                return error (new FileError("Zip file not found: " + filename, pathname));
             }
-        }
-        String truename = filename;
-        InputStream in = null;
-        if (zipfile != null) {
-            String name = file.getName();
-            int index = name.lastIndexOf('.');
-            Debug.assertTrue(index >= 0);
-            name = name.substring(0, index).concat("._");
-            ZipEntry entry = zipfile.getEntry(name);
-            if (entry != null) {
-                try {
-                    in = zipfile.getInputStream(entry);
-                }
-                catch (IOException e) {
-                    return error(new LispError(e.getMessage()));
-                }
+            ZipEntry entry = zipfile.getEntry(zipEntryName);
+            if (null == entry) {
+                // try appending "._" to base filename
+                int index = zipEntryName.lastIndexOf('.');
+                if (-1 == index) index = zipEntryName.length();
+                zipEntryName = zipEntryName.substring(0, index).concat("._");
+                entry = zipfile.getEntry(zipEntryName);
             }
+            if (null == entry) {
+                return error (new FileError("Can't read zip file entry " + zipEntryName, pathname));
+            }
+            try {
+                in = zipfile.getInputStream(entry);
+            }
+            catch (IOException e) {
+                return error(new LispError(e.getMessage()));
+            }
         } else {
             try {
                 in = new FileInputStream(file);
