diff options
author | rubidium <rubidium@openttd.org> | 2011-09-08 09:55:04 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-09-08 09:55:04 +0000 |
commit | 62777dbd84f380b701e7be8b6aac86af9a511de4 (patch) | |
tree | 698bb9ce6358115bbd58f5796f47e21daa19d87a /src/script/script_scanner.cpp | |
parent | 414c397000935162df4641dbe0c056b39d32205e (diff) | |
download | openttd-62777dbd84f380b701e7be8b6aac86af9a511de4.tar.xz |
(svn r22905) -Fix [FS#4753] (r22836): the name of the tar was removed from the AI filenames, so record it differently. Also removes some of the hackery to get the tar's filename
Diffstat (limited to 'src/script/script_scanner.cpp')
-rw-r--r-- | src/script/script_scanner.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/script_scanner.cpp b/src/script/script_scanner.cpp index 75f4ba074..9a4988d68 100644 --- a/src/script/script_scanner.cpp +++ b/src/script/script_scanner.cpp @@ -23,6 +23,14 @@ bool ScriptScanner::AddFile(const char *filename, size_t basepath_length, const this->main_script = strdup(filename); if (this->main_script == NULL) return false; + free(this->tar_file); + if (tar_filename != NULL) { + this->tar_file = strdup(tar_filename); + if (this->tar_file == NULL) return false; + } else { + this->tar_file = NULL; + } + const char *end = this->main_script + strlen(this->main_script) + 1; char *p = strrchr(this->main_script, PATHSEPCHAR); if (p == NULL) { |