From 51bab1e62ea1a017f01f4260356a95c77a0c5fc3 Mon Sep 17 00:00:00 2001 From: Daniel Hammer Date: Thu, 9 Jul 2026 11:19:06 +0200 Subject: [PATCH] feat: fix ramdisk file copies being incorrectly marked as directories, update man pages --- kernel/src/Fs/Ramdisk.cpp | 7 + montaukos.org/downloads.html | 3 +- programs/man/fetch.1 | 2 +- programs/man/file.2 | 47 ++- programs/man/intro.1 | 57 +++- programs/man/shell.1 | 172 +++++++--- programs/man/spawn.2 | 6 +- programs/man/syscalls.2 | 614 +++++++++++++++++++++++++++++++++-- programs/man/wiki.1 | 2 +- 9 files changed, 793 insertions(+), 117 deletions(-) diff --git a/kernel/src/Fs/Ramdisk.cpp b/kernel/src/Fs/Ramdisk.cpp index 3956e3b..8a224a5 100644 --- a/kernel/src/Fs/Ramdisk.cpp +++ b/kernel/src/Fs/Ramdisk.cpp @@ -218,6 +218,13 @@ namespace Fs::Ramdisk { } int ReadDirAt(const char* path, const char** outNames, int maxEntries, int startIndex) { + // Reject outright if path names an existing regular file: without this, + // a file with no matching "path/..." children below falls through to + // the child-scan loop and returns 0 (empty), which callers that use + // ReadDir to test "is this a directory" (>= 0) misread as "yes". + int selfIdx = FindEntryByPath(path); + if (selfIdx >= 0 && !fileTable[selfIdx].isDirectory) return -1; + // Normalize path: skip leading '/' if (path[0] == '/') path++; diff --git a/montaukos.org/downloads.html b/montaukos.org/downloads.html index 7132f08..79c3312 100644 --- a/montaukos.org/downloads.html +++ b/montaukos.org/downloads.html @@ -132,9 +132,10 @@

Known issues

Included in ISO