Tom found a bug when trying to load an applet without the last '\' in
the address. 

appletviewer http://www.ditchnet.org/applets/scribble/ would work but
appletviewer http://www.ditchnet.org/applets/scribble would not.

This is fixed.

2006-05-24  Lillian Angel  <[EMAIL PROTECTED]>

        * tools/gnu/classpath/tools/appletviewer/AppletTag.java
        (prependCodeBase): Added check to determine if the documentbase
        points to a directory or a file.

Index: tools/gnu/classpath/tools/appletviewer/AppletTag.java
===================================================================
RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/appletviewer/AppletTag.java,v
retrieving revision 1.1
diff -u -r1.1 AppletTag.java
--- tools/gnu/classpath/tools/appletviewer/AppletTag.java	8 May 2006 20:36:46 -0000	1.1
+++ tools/gnu/classpath/tools/appletviewer/AppletTag.java	24 May 2006 20:12:39 -0000
@@ -451,15 +451,19 @@
         else
           {
             String dirname = documentbase.getFile();
-            
-            // Determine dirname for file by stripping everything
-            // past the last file separator.
-            dirname = dirname.substring(0,
-                                        dirname.lastIndexOf(File.separatorChar) + 1);
-            
-            fullcodebase = new URL(documentbase.getProtocol(),
-                                   documentbase.getHost(),
-                                   documentbase.getPort(), dirname);
+            if (!new File(dirname).isFile())
+              fullcodebase = new URL(documentbase + File.separator);
+            else
+              {
+                // Determine dirname for file by stripping everything
+                // past the last file separator.
+                dirname = dirname.substring(0,
+                                            dirname.lastIndexOf(File.separatorChar) + 1);
+
+                fullcodebase = new URL(documentbase.getProtocol(),
+                                       documentbase.getHost(),
+                                       documentbase.getPort(), dirname);
+              }
           }
       }
     else

Reply via email to