diff options
author | Willem Jan Palenstijn | 2014-01-23 09:47:48 -0800 |
---|---|---|
committer | Willem Jan Palenstijn | 2014-01-23 09:47:48 -0800 |
commit | 22acfe82d4b870a86ca3f4af2c04ab0ca387cb41 (patch) | |
tree | 02f005f2e794d591f9920715e9746a321303f5bc | |
parent | 3fd28f31a766c5e9075d4ebd953b3b022de1f0a2 (diff) | |
parent | 219a68eeda2c0e14a29f1cfb969dabe3a70e1544 (diff) | |
download | scummvm-rg350-22acfe82d4b870a86ca3f4af2c04ab0ca387cb41.tar.gz scummvm-rg350-22acfe82d4b870a86ca3f4af2c04ab0ca387cb41.tar.bz2 scummvm-rg350-22acfe82d4b870a86ca3f4af2c04ab0ca387cb41.zip |
Merge pull request #424 from wjp/amigaos4-fs
AMIGAOS4: FSNode fixes
-rw-r--r-- | backends/fs/amigaos4/amigaos4-fs.cpp | 13 | ||||
-rw-r--r-- | backends/fs/amigaos4/amigaos4-fs.h | 6 |
2 files changed, 13 insertions, 6 deletions
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp index 6d713f10be..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,6 +327,9 @@ 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 @@ -341,6 +339,9 @@ bool AmigaOSFilesystemNode::isReadable() const { } 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) diff --git a/backends/fs/amigaos4/amigaos4-fs.h b/backends/fs/amigaos4/amigaos4-fs.h index c5ca61476f..7ce9981479 100644 --- a/backends/fs/amigaos4/amigaos4-fs.h +++ b/backends/fs/amigaos4/amigaos4-fs.h @@ -43,7 +43,13 @@ */ class AmigaOSFilesystemNode : public AbstractFSNode { protected: + /** + * The main file lock. + * If this is NULL but _bIsValid is true, then this Node references + * the virtual filesystem root. + */ BPTR _pFileLock; + Common::String _sDisplayName; Common::String _sPath; bool _bIsDirectory; |