aboutsummaryrefslogtreecommitdiff
path: root/backends/fs
diff options
context:
space:
mode:
authorJohannes Schickel2007-09-22 20:47:41 +0000
committerJohannes Schickel2007-09-22 20:47:41 +0000
commit2115e5d181697da99fd962a16690f44678cbfc2c (patch)
treebbbb2cebb293c033b5c96f79d2c3297d029e4f15 /backends/fs
parent04feab16897e3af3d5689f262b957999e477a35f (diff)
downloadscummvm-rg350-2115e5d181697da99fd962a16690f44678cbfc2c.tar.gz
scummvm-rg350-2115e5d181697da99fd962a16690f44678cbfc2c.tar.bz2
scummvm-rg350-2115e5d181697da99fd962a16690f44678cbfc2c.zip
Hopefully fix amigos4 fs implementation.
svn-id: r29029
Diffstat (limited to 'backends/fs')
-rw-r--r--backends/fs/amigaos4/amigaos4-fs.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index 4ad02e0655..b30b5c6eeb 100644
--- a/backends/fs/amigaos4/amigaos4-fs.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs.cpp
@@ -106,6 +106,28 @@ public:
virtual AbstractFSList listVolumes() const;
};
+// TODO: this is ripped of
+// AmigaOSFilesystemNode::AmigaOSFilesystemNode(const String &p)
+// maybe change it to use this function instead?
+/**
+ * Returns the last component of a given path.
+ *
+ * @param str String containing the path.
+ * @return Pointer to the first char of the last component inside str.
+ */
+const char *lastPathComponent(const Common::String &str) {
+ int offset = p.size();
+ const char *str = p.c_str();
+
+ while (offset > 0 && (str[offset-1] == '/' || str[offset-1] == ':'))
+ offset--;
+
+ while (offset > 0 && (str[offset-1] != '/' && str[offset-1] != ':'))
+ offset--;
+
+ return str.c_str() + offset;
+}
+
AmigaOSFilesystemNode::AmigaOSFilesystemNode() {
ENTER();
_sDisplayName = "Available Disks";