diff options
author | Berbe <4251220+Berbe@users.noreply.github.com> | 2019-05-01 19:57:23 +0200 |
---|---|---|
committer | PeterN <peter1138@openttd.org> | 2019-05-01 18:57:23 +0100 |
commit | 04c74355ba4ffd931b32d2b4248ef9c522ef0a84 (patch) | |
tree | 6d35743d726be4073a5d713f58dd10899d9c21f9 | |
parent | 76788a1eb39366323abc07161684ba94953987c6 (diff) | |
download | openttd-04c74355ba4ffd931b32d2b4248ef9c522ef0a84.tar.xz |
Fix: IniLoadFile::LoadFromDisk expects filename but BaseMedia::AddFile provided full path (#7348)
-rw-r--r-- | src/base_media_func.h | 4 |
1 files changed, 2 insertions, 2 deletions
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<Tbase_set>::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'; |