mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Fix some issues with zipos and redbean
- redbean.com -D /zip/dir/ now works, for pure fun - possibly fixed bug with redbean serving empty files - zipos stat() mode now indicates directories on windows See #372
This commit is contained in:
parent
4881ae7527
commit
d57f87dc40
4 changed files with 49 additions and 9 deletions
|
@ -28,12 +28,8 @@ int __zipos_stat_impl(struct Zipos *zipos, size_t cf, struct stat *st) {
|
|||
size_t lf;
|
||||
if (zipos && st) {
|
||||
bzero(st, sizeof(*st));
|
||||
if (ZIP_CFILE_FILEATTRCOMPAT(zipos->map + cf) == kZipOsUnix) {
|
||||
st->st_mode = ZIP_CFILE_EXTERNALATTRIBUTES(zipos->map + cf) >> 16;
|
||||
} else {
|
||||
st->st_mode = 0100644;
|
||||
}
|
||||
lf = GetZipCfileOffset(zipos->map + cf);
|
||||
st->st_mode = GetZipCfileMode(zipos->map + cf);
|
||||
st->st_size = GetZipLfileUncompressedSize(zipos->map + lf);
|
||||
st->st_blocks =
|
||||
roundup(GetZipLfileCompressedSize(zipos->map + lf), 512) / 512;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue