projects
/
org.ibex.core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d2152c4
)
2002/10/15 20:48:08
author
megacz
<megacz@xwt.org>
Fri, 30 Jan 2004 06:50:48 +0000
(06:50 +0000)
committer
megacz
<megacz@xwt.org>
Fri, 30 Jan 2004 06:50:48 +0000
(06:50 +0000)
darcs-hash:
20040130065048
-2ba56-
17074d209988b7711fa38d4613fcea260ab84152
.gz
src/org/xwt/Resources.java
patch
|
blob
|
history
diff --git
a/src/org/xwt/Resources.java
b/src/org/xwt/Resources.java
index
a4459d0
..
52e0980
100644
(file)
--- a/
src/org/xwt/Resources.java
+++ b/
src/org/xwt/Resources.java
@@
-83,8
+83,17
@@
public class Resources {
return super.read();
}
public int read(byte[] b, int off, int len) throws IOException {
return super.read();
}
public int read(byte[] b, int off, int len) throws IOException {
- int ret = super.read(b, off, len);
- if (ret != -1) bytesDownloaded += ret;
+ 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;
+ }
+
if (clear && callback != null) {
clear = false;
ThreadMessage.newthread(new JSObject.JSFunction() {
if (clear && callback != null) {
clear = false;
ThreadMessage.newthread(new JSObject.JSFunction() {
@@
-98,12
+107,15
@@
public class Resources {
}
});
}
}
});
}
+
+ bytesDownloaded += ret;
return ret;
}
});
for(ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) {
String name = ze.getName();
return ret;
}
});
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;
if (!validResourceName(name.substring(name.lastIndexOf('/') + 1))) {
if (Log.on) Log.log(Resources.class, "WARNING: ignoring xwar entry with invalid name: " + name);
continue;