mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
Fixing other FS backends to use the bug fixed version of the POSIX lastPathComponent too (also lets the Windows FS use the POSIX version of lastPathComponent too, since it's nicer than the fix I made)
svn-id: r23796
This commit is contained in:
parent
d9cb390a7b
commit
ac45e290f7
@ -59,13 +59,14 @@ static const char *lastPathComponent(const Common::String &str) {
|
||||
const char *start = str.c_str();
|
||||
const char *cur = start + str.size() - 2;
|
||||
|
||||
while (cur > start && *cur != '/') {
|
||||
while (cur >= start && *cur != '/') {
|
||||
--cur;
|
||||
}
|
||||
|
||||
return cur + 1;
|
||||
}
|
||||
|
||||
|
||||
AbstractFilesystemNode *AbstractFilesystemNode::getCurrentDirectory() {
|
||||
// Since there is no way to _set_ the current directory,
|
||||
// it will always be /...
|
||||
|
@ -194,11 +194,11 @@ bool GP32FilesystemNode::listDir(AbstractFSList &myList, ListMode mode) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
const char *lastPathComponent(const Common::String &str) {
|
||||
static const char *lastPathComponent(const Common::String &str) {
|
||||
const char *start = str.c_str();
|
||||
const char *cur = start + str.size() - 2;
|
||||
|
||||
while (cur > start && *cur != '\\') {
|
||||
while (cur >= start && *cur != '/') {
|
||||
--cur;
|
||||
}
|
||||
|
||||
|
@ -61,8 +61,9 @@ static const char *lastPathComponent(const Common::String &str) {
|
||||
const char *start = str.c_str();
|
||||
const char *cur = start + str.size() - 2;
|
||||
|
||||
while (cur > start && *cur != '/')
|
||||
while (cur >= start && *cur != '/') {
|
||||
--cur;
|
||||
}
|
||||
|
||||
return cur + 1;
|
||||
}
|
||||
|
@ -133,11 +133,11 @@ bool PSPFilesystemNode::listDir(AbstractFSList &myList, ListMode mode) const {
|
||||
}
|
||||
}
|
||||
|
||||
const char *lastPathComponent(const Common::String &str) {
|
||||
static const char *lastPathComponent(const Common::String &str) {
|
||||
const char *start = str.c_str();
|
||||
const char *cur = start + str.size() - 2;
|
||||
|
||||
while (cur > start && *cur != '/') {
|
||||
while (cur >= start && *cur != '/') {
|
||||
--cur;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ static const char *lastPathComponent(const Common::String &str) {
|
||||
const char *start = str.c_str();
|
||||
const char *cur = start + str.size() - 2;
|
||||
|
||||
while (cur > start && *cur != '\\') {
|
||||
while (cur >= start && *cur != '/') {
|
||||
--cur;
|
||||
}
|
||||
|
||||
|
@ -65,13 +65,10 @@ static const char *lastPathComponent(const Common::String &str) {
|
||||
const char *start = str.c_str();
|
||||
const char *cur = start + str.size() - 2;
|
||||
|
||||
while (cur > start && *cur != '\\') {
|
||||
while (cur >= start && *cur != '/') {
|
||||
--cur;
|
||||
}
|
||||
|
||||
if (cur == start)
|
||||
return cur;
|
||||
|
||||
return cur + 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user