diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -586,7 +586,7 @@ public: { } - bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override; + bool AddFile(const std::string &filename, size_t basepath_length, const std::string &tar_filename) override; /** Do the scan for GRFs. */ static uint DoScan() @@ -600,9 +600,9 @@ public: } }; -bool GRFFileScanner::AddFile(const char *filename, size_t basepath_length, const char *tar_filename) +bool GRFFileScanner::AddFile(const std::string &filename, size_t basepath_length, const std::string &tar_filename) { - GRFConfig *c = new GRFConfig(filename + basepath_length); + GRFConfig *c = new GRFConfig(filename.c_str() + basepath_length); bool added = true; if (FillGRFDetails(c, false)) {