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;