Skip to content

Commit

Permalink
Fix directory crash for filenames that appear elsewhere in the path
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Jul 12, 2024
1 parent 566ad81 commit f5ab26a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/filesystem/source/file_directory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int FDirectory::AddDirectory(const char *dirpath, LumpFilterInfo* filter, FileSy
if (mBasePath == nullptr)
{
// extract the base path from the first entry to cover changes made in ScanDirectory.
auto full = entry.FilePath.find(entry.FilePathRel);
auto full = entry.FilePath.rfind(entry.FilePathRel);
std::string path(entry.FilePath, 0, full);
mBasePath = stringpool->Strdup(path.c_str());
}
Expand Down

0 comments on commit f5ab26a

Please sign in to comment.