Fix: IniLoadFile::LoadFromDisk expects filename but BaseMedia::AddFile provided full path (#7348)

(cherry picked from commit 04c74355ba)
This commit is contained in:
Berbe 2019-05-01 19:57:23 +02:00 committed by Jonathan G Rennison
parent 080de98c93
commit a73ec8d386

View File

@ -159,9 +159,9 @@ bool BaseMedia<Tbase_set>::AddFile(const char *filename, size_t basepath_length,
Tbase_set *set = new Tbase_set(); Tbase_set *set = new Tbase_set();
IniFile *ini = new IniFile(); IniFile *ini = new IniFile();
ini->LoadFromDisk(filename, BASESET_DIR);
char *path = stredup(filename + basepath_length); char *path = stredup(filename + basepath_length);
ini->LoadFromDisk(path, BASESET_DIR);
char *psep = strrchr(path, PATHSEPCHAR); char *psep = strrchr(path, PATHSEPCHAR);
if (psep != nullptr) { if (psep != nullptr) {
psep[1] = '\0'; psep[1] = '\0';