2003/04/10 01:41:43
[org.ibex.core.git] / src / org / xwt / Resources.java
index 52e0980..59884c9 100644 (file)
@@ -39,9 +39,8 @@ public class Resources {
             char c = name.charAt(i);
             if (!((c >= 'A' && c <= 'Z') ||
                   (c >= 'a' && c <= 'z') ||
-                  c == '_' ||
-                  (c >= '0' && c <= '9') ||
-                  (c == '.' && i == name.length() - 4))) return false;
+                  c == '_' || c == '.' || 
+                  (c >= '0' && c <= '9'))) return false;
         }
         return true;
     }
@@ -83,17 +82,7 @@ public class Resources {
                     return super.read();
                 }
                 public int read(byte[] b, int off, int len) throws IOException {
-                    int ret = 0;
-
-                    // Ugly hack to work around libgcj zlib bug -- always try to fill the buffer completely
-                    while (len > 0) {
-                        int read = super.read(b, off, len);
-                        if (read == -1) break;
-                        ret += read;
-                        len -= read;
-                        off += read;
-                    }
-
+                    int ret = super.read(b, off, len);
                     if (clear && callback != null) {
                         clear = false;
                         ThreadMessage.newthread(new JSObject.JSFunction() {
@@ -107,7 +96,6 @@ public class Resources {
                                 }                            
                             });
                     }
-
                     bytesDownloaded += ret;
                     return ret;
                 }
@@ -115,7 +103,6 @@ public class Resources {
 
         for(ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) {
             String name = ze.getName();
-            if (Log.on) Log.log(Resources.class, name);
             if (!validResourceName(name.substring(name.lastIndexOf('/') + 1))) {
                 if (Log.on) Log.log(Resources.class, "WARNING: ignoring xwar entry with invalid name: " + name);
                 continue;