From 5ed8d680c0a56a799af5705630c103f5e70978df Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 15 Jan 2002 19:54:55 +0000 Subject: [PATCH] Fix to osgDB::getStrippedName(..) so that handles the case of file without an extension. --- src/osgDB/FileNameUtils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osgDB/FileNameUtils.cpp b/src/osgDB/FileNameUtils.cpp index 5ebc8d694..c2768572c 100644 --- a/src/osgDB/FileNameUtils.cpp +++ b/src/osgDB/FileNameUtils.cpp @@ -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;