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.
This commit is contained in:
Robert Osfield
2008-04-02 13:57:26 +00:00
parent f5c9b548a8
commit 0ab29e1502

View File

@@ -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;