Fix to osgDB::getStrippedName(..) so that handles the case of file without

an extension.
This commit is contained in:
Robert Osfield
2002-01-15 19:54:55 +00:00
parent ff61505789
commit 5ed8d680c0

View File

@@ -49,6 +49,11 @@ std::string osgDB::getStrippedName(const std::string& fileName)
{
std::string::size_type slash = fileName.find_last_of('/');
std::string::size_type dot = fileName.find_last_of('.');
// Ignore '.'s that aren't in the last component
if (slash != std::string::npos && dot < slash)
dot = std::string::npos;
if (slash==std::string::npos)
{
if (dot==std::string::npos) return fileName;