Code cleanup
This commit is contained in:
parent
702a213175
commit
b1c730405f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue