mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-19 08:01:50 +00:00
Fix directory crash for filenames that appear elsewhere in the path
This commit is contained in:
parent
0caa036a96
commit
9d78eb5aa0
1 changed files with 1 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue