diff options
Diffstat (limited to 'backends/fs/amigaos4/amigaos4-fs.cpp')
-rw-r--r-- | backends/fs/amigaos4/amigaos4-fs.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp index fe388c2a6e..bd8bf1978a 100644 --- a/backends/fs/amigaos4/amigaos4-fs.cpp +++ b/backends/fs/amigaos4/amigaos4-fs.cpp @@ -81,6 +81,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) { _sDisplayName = ::lastPathComponent(_sPath); _pFileLock = 0; _bIsDirectory = false; + _bIsValid = false; // Check whether the node exists and if it is a directory struct ExamineData * pExd = IDOS->ExamineObjectTags(EX_StringNameInput,_sPath.c_str(),TAG_END); @@ -305,12 +306,6 @@ bool AmigaOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b AbstractFSNode *AmigaOSFilesystemNode::getParent() const { ENTER(); - if (!_bIsDirectory) { - debug(6, "Not a directory"); - LEAVE(); - return 0; - } - if (_pFileLock == 0) { debug(6, "Root node"); LEAVE(); @@ -332,19 +327,25 @@ AbstractFSNode *AmigaOSFilesystemNode::getParent() const { } bool AmigaOSFilesystemNode::isReadable() const { + if (!_bIsValid) + return false; + // Regular RWED protection flags are low-active or inverted, thus the negation. // moreover pseudo root filesystem (null _pFileLock) is readable whatever the // protection says - bool readable = !(_nProt & EXDF_READ) || _pFileLock == 0; + bool readable = !(_nProt & EXDF_OTR_READ) || _pFileLock == 0; return readable; } bool AmigaOSFilesystemNode::isWritable() const { + if (!_bIsValid) + return false; + // Regular RWED protection flags are low-active or inverted, thus the negation. // moreover pseudo root filesystem (null _pFileLock) is never writable whatever // the protection says (because of the pseudo nature) - bool writable = !(_nProt & EXDF_WRITE) && _pFileLock !=0; + bool writable = !(_nProt & EXDF_OTR_WRITE) && _pFileLock !=0; return writable; } @@ -367,8 +368,14 @@ AbstractFSList AmigaOSFilesystemNode::listVolumes() const { dosList = IDOS->NextDosEntry(dosList, LDF_VOLUMES); while (dosList) { if (dosList->dol_Type == DLT_VOLUME && - dosList->dol_Name && - dosList->dol_Task) { + dosList->dol_Name) { + + // Original was + // dosList->dol_Name && + // dosList->dol_Task) { + // which errored using SDK 53.24 with a 'struct dosList' has no member called 'dol_Task' + // I removed dol_Task because it's not used anywhere else + // and it neither brought up further errors nor crashes or regressions. // Copy name to buffer IDOS->CopyStringBSTRToC(dosList->dol_Name, buffer, MAXPATHLEN); |