From e9e9fcfd59c21508bc1144b7ed35824e41c6eef1 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 17 Feb 2019 21:18:11 -0500 Subject: [PATCH] host mli - opening/closing a directory would close fd 0 (aka stdin). --- src/host_mli.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/host_mli.c b/src/host_mli.c index 5356e94..48bec74 100644 --- a/src/host_mli.c +++ b/src/host_mli.c @@ -1048,6 +1048,11 @@ static int mli_open(unsigned dcb, const char *name, const char *path) { word16 terr = host_get_file_info(path, &fi); if (terr) return terr; +#if _WIN32 + file->h = INVALID_HANDLE_VALUE; +#else + file->fd = -1; +#endif if (fi.storage_type == 0x0f || fi.storage_type == 0x0d) { unsigned blocks;