Skip to content

Commit

Permalink
ported directory loading fix from GZDoom
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Jan 18, 2024
1 parent 436f24a commit cab73b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/common/filesystem/source/file_directory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,15 @@ int FDirectory::AddDirectory(const char *dirpath, LumpFilterInfo* filter, FileSy
Printf(FSMessageLevel::Warning, "%s is larger than 2GB and will be ignored\n", entry.FilePath.c_str());
continue;
}
// for accessing the file we need to retain the original unaltered path.
// On Linux this is important because its file system is case sensitive,
// but even on Windows the Unicode normalization is destructive
// for some characters and cannot be used for file names.
// Examples for this are the Turkish 'i's or the German ß.
SystemFilePath[count] = stringpool->Strdup(entry.FilePathRel.c_str());
// for internal access we use the normalized form of the relative path.
// this is fine because the paths that get compared against this will also be normalized.
Entries[count].FileName = NormalizeFileName(entry.FilePathRel.c_str());
SystemFilePath[count] = Entries[count].FileName;
Entries[count].CompressedSize = Entries[count].Length = entry.Length;
Entries[count].Flags = RESFF_FULLPATH;
Entries[count].ResourceID = -1;
Expand Down

0 comments on commit cab73b8

Please sign in to comment.