[Scummvm-cvs-logs] SF.net SVN: scummvm: [22267] scummvm/trunk/backends/fs/amigaos4/amigaos4-fs.cpp
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Mon May 1 14:54:03 CEST 2006
Revision: 22267
Author: fingolfin
Date: 2006-05-01 14:53:31 -0700 (Mon, 01 May 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22267&view=rev
Log Message:
-----------
Patch #1479919 (AmigaOS maintaining)
Modified Paths:
--------------
scummvm/trunk/backends/fs/amigaos4/amigaos4-fs.cpp
Modified: scummvm/trunk/backends/fs/amigaos4/amigaos4-fs.cpp
===================================================================
--- scummvm/trunk/backends/fs/amigaos4/amigaos4-fs.cpp 2006-05-01 21:31:06 UTC (rev 22266)
+++ scummvm/trunk/backends/fs/amigaos4/amigaos4-fs.cpp 2006-05-01 21:53:31 UTC (rev 22267)
@@ -114,11 +114,8 @@
}
_sDisplayName = String(str + offset, len);
-
_pFileLock = 0;
- // Check whether it is a directory, and whether the file actually exists
-
struct FileInfoBlock *fib = (struct FileInfoBlock *)IDOS->AllocDosObject(DOS_FIB, NULL);
if (!fib) {
debug(6, "FileInfoBlock is NULL");
@@ -126,22 +123,25 @@
return;
}
+ // Check whether the node exists and if it is a directory
BPTR pLock = IDOS->Lock((STRPTR)_sPath.c_str(), SHARED_LOCK);
if (pLock) {
if (IDOS->Examine(pLock, fib) != DOSFALSE) {
- if (fib->fib_EntryType > 0)
+ if (FIB_IS_DRAWER(fib)) {
_bIsDirectory = true;
- else
- _bIsDirectory = false;
+ _pFileLock = IDOS->DupLock(pLock);
+ _bIsValid = (_pFileLock != 0);
- if (_bIsDirectory) {
- if (fib->fib_EntryType != ST_ROOT)
- _sPath += "/";
+ // Add a trailing slash if it is needed
+ const char c = _sPath.lastChar();
+ if (c != '/' && c != ':')
+ _sPath += '/';
- _pFileLock = IDOS->DupLock(pLock);
- _bIsValid = (_pFileLock != 0);
}
- else _bIsValid = true;
+ else {
+ _bIsDirectory = false;
+ _bIsValid = true;
+ }
}
}
@@ -184,19 +184,19 @@
}
if (IDOS->Examine(pLock, fib) != DOSFALSE) {
- if (fib->fib_EntryType > 0)
+ if (FIB_IS_DRAWER(fib)) {
_bIsDirectory = true;
- else
- _bIsDirectory = false;
+ _pFileLock = IDOS->DupLock(pLock);
+ _bIsValid = _pFileLock != 0;
- if (_bIsDirectory) {
- if (fib->fib_EntryType != ST_ROOT)
- _sPath += "/";
-
- _pFileLock = IDOS->DupLock(pLock);
- _bIsValid = (_pFileLock != 0);
+ const char c = _sPath.lastChar();
+ if (c != '/' && c != ':')
+ _sPath += '/';
}
- else _bIsValid = true;
+ else {
+ _bIsDirectory = false;
+ _bIsValid = true;
+ }
}
IDOS->FreeDosObject(DOS_FIB, fib);
@@ -325,7 +325,12 @@
}
AbstractFilesystemNode *AmigaOSFilesystemNode::child(const String &name) const {
- TODO
+ assert(_bIsDirectory);
+ String newPath(_sPath);
+ if (_sPath.lastChar() != '/')
+ newPath += '/';
+ newPath += name;
+ return new AmigaOSFilesystemNode(newPath);
}
FSList AmigaOSFilesystemNode::listVolumes(void) const {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list