mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-01-31 18:50:33 +00:00
- fixed: FResourceFile::FilterLumps must use a proper copy of the filename to pass to LumpNameSetup instead of a pointer to the file name's stringbuffer, because that function will overwrite the variable it is taken from.
This commit is contained in:
parent
25e19ab471
commit
1fddd1859e
1 changed files with 2 additions and 3 deletions
|
@ -98,8 +98,7 @@ void FResourceLump::LumpNameSetup(const char *iname)
|
||||||
base = base.Left(base.LastIndexOf('.'));
|
base = base.Left(base.LastIndexOf('.'));
|
||||||
uppercopy(Name, base);
|
uppercopy(Name, base);
|
||||||
Name[8] = 0;
|
Name[8] = 0;
|
||||||
FString temp = iname; // Note: iname can point to inside FullName's string buffer so we cannot do the assignment directly.
|
FullName = iname;
|
||||||
FullName = temp;
|
|
||||||
|
|
||||||
// Map some directories to WAD namespaces.
|
// Map some directories to WAD namespaces.
|
||||||
// Note that some of these namespaces don't exist in WADS.
|
// Note that some of these namespaces don't exist in WADS.
|
||||||
|
@ -382,7 +381,7 @@ int FResourceFile::FilterLumps(FString filtername, void *lumps, size_t lumpsize,
|
||||||
{
|
{
|
||||||
FResourceLump *lump = (FResourceLump *)lump_p;
|
FResourceLump *lump = (FResourceLump *)lump_p;
|
||||||
assert(lump->FullName.CompareNoCase(filter, (int)filter.Len()) == 0);
|
assert(lump->FullName.CompareNoCase(filter, (int)filter.Len()) == 0);
|
||||||
lump->LumpNameSetup(&lump->FullName[filter.Len()]);
|
lump->LumpNameSetup(lump->FullName.Mid(filter.Len()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move filtered lumps to the end of the lump list.
|
// Move filtered lumps to the end of the lump list.
|
||||||
|
|
Loading…
Reference in a new issue