mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-06 18:27:26 +00:00
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.
This commit is contained in:
parent
3fd28f31a7
commit
58aaef33c1
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user