diff --git a/src/resourcefiles/resourcefile.cpp b/src/resourcefiles/resourcefile.cpp index b4280adf6..6b4c8c29b 100644 --- a/src/resourcefiles/resourcefile.cpp +++ b/src/resourcefiles/resourcefile.cpp @@ -90,11 +90,10 @@ FResourceLump::~FResourceLump() // //========================================================================== -void FResourceLump::LumpNameSetup(const char *iname) +void FResourceLump::LumpNameSetup(FString iname) { - const char *lname = strrchr(iname,'/'); - lname = (lname == NULL) ? iname : lname + 1; - FString base = lname; + long slash = iname.LastIndexOf('/'); + FString base = (slash >= 0) ? iname.Mid(slash + 1) : iname; base = base.Left(base.LastIndexOf('.')); uppercopy(Name, base); Name[8] = 0; diff --git a/src/resourcefiles/resourcefile.h b/src/resourcefiles/resourcefile.h index 9927b1eae..c62981ca7 100644 --- a/src/resourcefiles/resourcefile.h +++ b/src/resourcefiles/resourcefile.h @@ -44,7 +44,7 @@ struct FResourceLump virtual FileReader *NewReader(); virtual int GetFileOffset() { return -1; } virtual int GetIndexNum() const { return 0; } - void LumpNameSetup(const char *iname); + void LumpNameSetup(FString iname); void CheckEmbedded(); void *CacheLump();