From a81b2341c67a241527c366d27c795430d446c5f1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 11 Mar 2011 11:20:30 +0000 Subject: [PATCH] Fixed the case insenstive search under unices --- src/osgDB/FileUtils.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index 3e2069a79..2ebeea6d9 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -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;