feat: fix ramdisk file copies being incorrectly marked as directories, update man pages

This commit is contained in:
2026-07-09 11:19:06 +02:00
parent 4f2bc72dc9
commit 51bab1e62e
9 changed files with 793 additions and 117 deletions
+7
View File
@@ -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++;