aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2014-01-22 22:51:44 +0100
committerWillem Jan Palenstijn2014-01-22 22:54:05 +0100
commit58aaef33c11e4f140c962f96e54a326baa724c0e (patch)
tree5fbeb2c4110ec9656c19696da156cf461a593d41 /backends/fs
parent3fd28f31a766c5e9075d4ebd953b3b022de1f0a2 (diff)
downloadscummvm-rg350-58aaef33c11e4f140c962f96e54a326baa724c0e.tar.gz
scummvm-rg350-58aaef33c11e4f140c962f96e54a326baa724c0e.tar.bz2
scummvm-rg350-58aaef33c11e4f140c962f96e54a326baa724c0e.zip
AMIGAOS4: Make isReadable return false for non-existent files
This also properly initializes _bIsValid for non-existent files. For consistency, isWritable() is changed analogously to isReadable(), even though it should not lead to changes in behaviour.
Diffstat (limited to 'backends/fs')
-rw-r--r--backends/fs/amigaos4/amigaos4-fs.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index 6d713f10be..d0578307f4 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);
@@ -332,6 +333,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 +345,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)