From 0ab29e15025e9d8b93a7416aa91fc3e4825cfa50 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 2 Apr 2008 13:57:26 +0000 Subject: [PATCH] From Mattias Helsing, "Subject: osga reading slash mismatch requests for files in a archive are made with unix style paths. So to be able to match an entry in map(_indexMap) it's keys needs to be stored in unix style even on Win32" Note from Robert Osfied, simplified this submission so that the added conversion to unix slahes is done on all platforms as this should be safe and simpler to maintain. --- src/osgPlugins/osga/OSGA_Archive.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/osga/OSGA_Archive.cpp b/src/osgPlugins/osga/OSGA_Archive.cpp index 9fdaa4cba..84a47c848 100644 --- a/src/osgPlugins/osga/OSGA_Archive.cpp +++ b/src/osgPlugins/osga/OSGA_Archive.cpp @@ -234,8 +234,9 @@ bool OSGA_Archive::IndexBlock::getFileReferences(FileNamePositionMap& indexMap) std::string filename(ptr, ptr+filename_size); - // record this entry into the FileNamePositionMap - indexMap[filename] = PositionSizePair(position,size); + // record this entry into the FileNamePositionMap. + // Requests for files will be in unix style even on Win32 so need unix style keys in map. + indexMap[osgDB::convertFileNameToUnixStyle(filename)] = PositionSizePair(position,size); ptr += filename_size;