aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJohannes Schickel2010-08-16 16:01:31 +0000
committerJohannes Schickel2010-08-16 16:01:31 +0000
commit7b51537be2341b62795c308c140faca387fa04e6 (patch)
tree76ad8edab7ba719037f47dc113f6fdbcadaca858 /common
parentc284e78cc0bbb0e861162c4c4cc8c765ec60d5f1 (diff)
downloadscummvm-rg350-7b51537be2341b62795c308c140faca387fa04e6.tar.gz
scummvm-rg350-7b51537be2341b62795c308c140faca387fa04e6.tar.bz2
scummvm-rg350-7b51537be2341b62795c308c140faca387fa04e6.zip
Common: Fix bug in lastPathComponent.
Prior to this change lastPathComponent would not create a correct result, when the input of lastPathComponent did not contain a single separator. I also added a test case for this in our unit tests. svn-id: r52123
Diffstat (limited to 'common')
-rw-r--r--common/str.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/str.cpp b/common/str.cpp
index 744ba46ec7..2a0130dbe4 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -626,7 +626,7 @@ Common::String lastPathComponent(const Common::String &path, const char sep) {
// Now scan the whole component
const char *first = last - 1;
- while (first >= str && *first != sep)
+ while (first > str && *first != sep)
--first;
if (*first == sep)