Fixed issue 786. It was a complex one. Basically, the comparison function used to sort the filename map was buggy and was not returning always the same result depending if the compared elements contained uppercases or not. I just removed the uppercase part and it now works fine.

This commit is contained in:
Xawotihs@gmail.com
2012-01-20 22:10:32 +00:00
parent 98bed484f4
commit 595f0b5690

View File

@@ -299,7 +299,6 @@ bool filesystem::DirExists(const std::string & folderName)
bool filesystem::FileExists(const std::string & fileName)
{
//Check in zip
file_info FileInfo;
@@ -443,7 +442,6 @@ void filesystem::InsertZip(const char * Filename, const size_t PackID)
const char * Name = &(* FileHdr.m_Filename.begin());
const unsigned short i = FileHdr.m_FilenameSize - 1;
if (FileHdr.m_FilenameSize != 0) {
m_Files[Name] = file_info(
PackID, // Package ID
FileHdr.m_RelOffset, // "Local File" header offset position
@@ -453,7 +451,7 @@ void filesystem::InsertZip(const char * Filename, const size_t PackID)
((Name[i] == '/') || (Name[i] == '\\')) // Is a directory?
);
++(ZipInfo.m_NbEntries);
++(ZipInfo.m_NbEntries);
ZipInfo.m_FilesSize += FileHdr.m_UncompSize;
ZipInfo.m_FilesCompSize += FileHdr.m_CompSize;
}
@@ -604,15 +602,13 @@ bool filesystem::lt_path::operator () (const string & s1, const string & s2) co
if ((A[i] == '\0') && (B[i] == '\0'))
return false;
// case insensitive and '/' is the same as '\'
// '/' is the same as '\'
if (! (
(A[i] == B[i] + ('a' - 'A')) ||
(A[i] == B[i] - ('a' - 'A')) ||
(A[i] == B[i]) ||
((A[i] == '\\') && (B[i] == '/')) ||
((A[i] == '/') && (B[i] == '\\'))
)) {
// This line puts uppercases first
if ((A[i] == '\0') || (A[i] < B[i]))
return true;
else