diff --git a/lib/path.cpp b/lib/path.cpp index df3422dd3..fab8540cd 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -228,17 +228,15 @@ std::string Path::getAbsoluteFilePath(const std::string& filePath) std::string Path::stripDirectoryPart(const std::string &file) { - std::string fileName(file); #if defined(_WIN32) const char native = '\\'; #else const char native = '/'; #endif - std::string::size_type p = fileName.rfind(native); - + const std::string::size_type p = file.rfind(native); if (p != std::string::npos) { - fileName = fileName.substr(p + 1); + return file.substr(p + 1); } - return fileName; + return file; }