feat: fix ramdisk file copies being incorrectly marked as directories, update man pages
This commit is contained in:
@@ -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++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user