From aba30d7ea8541f7260ec7b96a8d33dd7dc06ed74 Mon Sep 17 00:00:00 2001 From: David Corrales Date: Sun, 7 Oct 2007 00:28:38 +0000 Subject: Commit of patch #1804861. It implements a static lastPathComponent() function in each backend, used to extract the last path component of a given path, returned by getName(). svn-id: r29159 --- backends/fs/psp/psp-fs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'backends/fs/psp') diff --git a/backends/fs/psp/psp-fs.cpp b/backends/fs/psp/psp-fs.cpp index dfe52c1125..518a54d7d9 100644 --- a/backends/fs/psp/psp-fs.cpp +++ b/backends/fs/psp/psp-fs.cpp @@ -64,7 +64,6 @@ public: virtual String getPath() const { return _path; } virtual bool isDirectory() const { return _isDirectory; } virtual bool isReadable() const { return true; } //FIXME: this is just a stub - virtual bool isValid() const { return _isValid; } virtual bool isWritable() const { return true; } //FIXME: this is just a stub virtual AbstractFilesystemNode *getChild(const String &n) const; @@ -83,6 +82,9 @@ public: * @return Pointer to the first char of the last component inside str. */ const char *lastPathComponent(const Common::String &str) { + if(str.empty()) + return ""; + const char *start = str.c_str(); const char *cur = start + str.size() - 2; @@ -170,8 +172,6 @@ bool PSPFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool } AbstractFilesystemNode *PSPFilesystemNode::getParent() const { - assert(_isValid); - if (_path == ROOT_PATH) return 0; -- cgit v1.2.3