From c60ffa6384770483afd7e8c3173c6bab9dc99a76 Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Mon, 6 Jan 2014 12:45:01 -0500 Subject: [PATCH] fix npos comparison check in baseName method --- src/config.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index 34a69e5..49ac673 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -110,12 +110,12 @@ void Config::read() static std::string baseName(const std::string &path) { - size_t pos = path.find_last_of("/\\") + 1; + size_t pos = path.find_last_of("/\\"); if (pos == path.npos) - pos = 0; + return path; - return path.substr(pos); + return path.substr(pos + 1); } void Config::readGameINI() -- 2.43.0