From 04c74355ba4ffd931b32d2b4248ef9c522ef0a84 Mon Sep 17 00:00:00 2001 From: Berbe <4251220+Berbe@users.noreply.github.com> Date: Wed, 1 May 2019 19:57:23 +0200 Subject: Fix: IniLoadFile::LoadFromDisk expects filename but BaseMedia::AddFile provided full path (#7348) --- src/base_media_func.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/base_media_func.h b/src/base_media_func.h index 42d5cad2f..98f855217 100644 --- a/src/base_media_func.h +++ b/src/base_media_func.h @@ -159,9 +159,9 @@ bool BaseMedia::AddFile(const char *filename, size_t basepath_length, Tbase_set *set = new Tbase_set(); IniFile *ini = new IniFile(); - ini->LoadFromDisk(filename, BASESET_DIR); - char *path = stredup(filename + basepath_length); + ini->LoadFromDisk(path, BASESET_DIR); + char *psep = strrchr(path, PATHSEPCHAR); if (psep != nullptr) { psep[1] = '\0'; -- cgit v1.2.3-70-g09d2