mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Improve zip read-only filesystem
readdir() will now always yield an inode that's consistent with stat() on ZipOS and Windows in general. More APIs have been updated to return the appropriate error code when inappropriately trying to do ops, like sockets, with a zip file descriptor. The path normalization algorithms are now fully fleshed out. Some socket APIs have been fixed so they'll raise EBADF vs. ENOTSOCK appropriately. Lastly seekdir() will now work properly on NetBSD and FreeBSD (not sure why anyone would even use it)
This commit is contained in:
parent
dc6c67256f
commit
b76b2be2d0
47 changed files with 644 additions and 269 deletions
|
@ -29,8 +29,9 @@ ssize_t __zipos_parseuri(const char *uri, struct ZiposUri *out) {
|
|||
uri[2] == 'i' && //
|
||||
uri[3] == 'p' && //
|
||||
(!uri[4] || uri[4] == '/')) &&
|
||||
strlcpy(out->path, uri + 4 + !!uri[4], ZIPOS_PATH_MAX) < ZIPOS_PATH_MAX) {
|
||||
return (out->len = __zipos_normpath(out->path));
|
||||
(len = __zipos_normpath(out->path, uri + 4 + !!uri[4],
|
||||
sizeof(out->path))) < sizeof(out->path)) {
|
||||
return (out->len = len);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue