openttd updated to 1.5.0-beta2
--HG-- branch : openttd
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: base_media_func.h 26073 2013-11-23 18:13:46Z rubidium $ */
|
||||
/* $Id: base_media_func.h 26637 2014-06-09 17:43:59Z rubidium $ */
|
||||
|
||||
/*
|
||||
* This file is part of OpenTTD.
|
||||
@@ -51,16 +51,16 @@ bool BaseSet<T, Tnum_files, Tsearch_in_tars>::FillSetDetails(IniFile *ini, const
|
||||
IniItem *item;
|
||||
|
||||
fetch_metadata("name");
|
||||
this->name = strdup(item->value);
|
||||
this->name = stredup(item->value);
|
||||
|
||||
fetch_metadata("description");
|
||||
this->description[strdup("")] = strdup(item->value);
|
||||
this->description[stredup("")] = stredup(item->value);
|
||||
|
||||
/* Add the translations of the descriptions too. */
|
||||
for (const IniItem *item = metadata->item; item != NULL; item = item->next) {
|
||||
if (strncmp("description.", item->name, 12) != 0) continue;
|
||||
|
||||
this->description[strdup(item->name + 12)] = strdup(item->value);
|
||||
this->description[stredup(item->name + 12)] = stredup(item->value);
|
||||
}
|
||||
|
||||
fetch_metadata("shortname");
|
||||
@@ -100,7 +100,7 @@ bool BaseSet<T, Tnum_files, Tsearch_in_tars>::FillSetDetails(IniFile *ini, const
|
||||
|
||||
/* Then find the MD5 checksum */
|
||||
item = md5s->GetItem(filename, false);
|
||||
if (item == NULL) {
|
||||
if (item == NULL || item->value == NULL) {
|
||||
DEBUG(grf, 0, "No MD5 checksum specified for: %s (in %s)", filename, full_filename);
|
||||
return false;
|
||||
}
|
||||
@@ -129,9 +129,9 @@ bool BaseSet<T, Tnum_files, Tsearch_in_tars>::FillSetDetails(IniFile *ini, const
|
||||
if (item == NULL) item = origin->GetItem("default", false);
|
||||
if (item == NULL) {
|
||||
DEBUG(grf, 1, "No origin warning message specified for: %s", filename);
|
||||
file->missing_warning = strdup("");
|
||||
file->missing_warning = stredup("");
|
||||
} else {
|
||||
file->missing_warning = strdup(item->value);
|
||||
file->missing_warning = stredup(item->value);
|
||||
}
|
||||
|
||||
switch (T::CheckMD5(file, BASESET_DIR)) {
|
||||
@@ -164,7 +164,7 @@ bool BaseMedia<Tbase_set>::AddFile(const char *filename, size_t basepath_length,
|
||||
IniFile *ini = new IniFile();
|
||||
ini->LoadFromDisk(filename, BASESET_DIR);
|
||||
|
||||
char *path = strdup(filename + basepath_length);
|
||||
char *path = stredup(filename + basepath_length);
|
||||
char *psep = strrchr(path, PATHSEPCHAR);
|
||||
if (psep != NULL) {
|
||||
psep[1] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user