file: Make sure is_memfile is properly cleared
diff --git a/limine-pxe.bin b/limine-pxe.bin
index 8d2e26d5..85cd4f51 100644
Binary files a/limine-pxe.bin and b/limine-pxe.bin differ
diff --git a/limine.bin b/limine.bin
index ef6639b2..57c90ebf 100644
Binary files a/limine.bin and b/limine.bin differ
diff --git a/stage2.map b/stage2.map
index d9c5f4ff..2e36b35d 100644
Binary files a/stage2.map and b/stage2.map differ
diff --git a/stage2/fs/file.c b/stage2/fs/file.c
index 491fdde5..db1d9200 100644
--- a/stage2/fs/file.c
+++ b/stage2/fs/file.c
@@ -21,6 +21,8 @@ bool fs_get_guid(struct guid *guid, struct part *part) {
}
int fopen(struct file_handle *ret, struct part *part, const char *filename) {
+ ret->is_memfile = false;
+
if (echfs_check_signature(part)) {
struct echfs_file_handle *fd = ext_mem_alloc(sizeof(struct echfs_file_handle));
diff --git a/stage2/lib/uri.c b/stage2/lib/uri.c
index bb88e4f2..6f752a55 100644
--- a/stage2/lib/uri.c
+++ b/stage2/lib/uri.c
@@ -138,6 +138,7 @@ static bool uri_tftp_dispatch(struct file_handle *fd, char *root, char *path) {
return false;
}
+ fd->is_memfile = false;
fd->fd = cfg;
fd->read = tftp_read;
fd->size = cfg->file_size;
@@ -177,8 +178,6 @@ static bool uri_boot_dispatch(struct file_handle *fd, char *s_part, char *path)
bool uri_open(struct file_handle *fd, char *uri) {
bool ret;
- memset(fd, 0, sizeof(struct file_handle));
-
char *resource, *root, *path;
uri_resolve(uri, &resource, &root, &path);
