Fixed the case insenstive search under unices

This commit is contained in:
Robert Osfield
2011-03-11 11:20:30 +00:00
parent 339fe794b0
commit a81b2341c6

View File

@@ -441,11 +441,13 @@ std::string osgDB::findFileInDirectory(const std::string& fileName,const std::st
// See if we're already at the top level of the filesystem
if ((parentPath.empty()) && (!lastElement.empty()))
{
std::string directoryStringToUse = (realDirName[0]=='/' || realDirName[0]=='\\') ? std::string("/") : std::string(".");
// Search for the first path element (ignoring case) in
// the top-level directory
realDirName = findFileInDirectory(lastElement, "/",
realDirName = findFileInDirectory(lastElement, directoryStringToUse,
CASE_INSENSITIVE);
dc = osgDB::getDirectoryContents(realDirName);
needFollowingBackslash = true;
needDirectoryName = true;