mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r12173) -Cleanup: Minor codestyle fixes.
This commit is contained in:
parent
db0eb9570c
commit
06de1215c1
|
@ -277,7 +277,7 @@ static bool ScanPathAddGrf(const char *filename)
|
||||||
_all_grfs = c;
|
_all_grfs = c;
|
||||||
} else {
|
} else {
|
||||||
/* Insert file into list at a position determined by its
|
/* Insert file into list at a position determined by its
|
||||||
* name, so the list is sorted as we go along */
|
* name, so the list is sorted as we go along */
|
||||||
GRFConfig **pd, *d;
|
GRFConfig **pd, *d;
|
||||||
bool stop = false;
|
bool stop = false;
|
||||||
for (pd = &_all_grfs; (d = *pd) != NULL; pd = &d->next) {
|
for (pd = &_all_grfs; (d = *pd) != NULL; pd = &d->next) {
|
||||||
|
@ -285,8 +285,11 @@ static bool ScanPathAddGrf(const char *filename)
|
||||||
/* Because there can be multiple grfs with the same name, make sure we checked all grfs with the same name,
|
/* Because there can be multiple grfs with the same name, make sure we checked all grfs with the same name,
|
||||||
* before inserting the entry. So insert a new grf at the end of all grfs with the same name, instead of
|
* before inserting the entry. So insert a new grf at the end of all grfs with the same name, instead of
|
||||||
* just after the first with the same name. Avoids doubles in the list. */
|
* just after the first with the same name. Avoids doubles in the list. */
|
||||||
if (strcasecmp(c->name, d->name) <= 0) stop = true;
|
if (strcasecmp(c->name, d->name) <= 0) {
|
||||||
else if (stop) break;
|
stop = true;
|
||||||
|
} else if (stop) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (added) {
|
if (added) {
|
||||||
c->next = d;
|
c->next = d;
|
||||||
|
@ -299,7 +302,7 @@ static bool ScanPathAddGrf(const char *filename)
|
||||||
|
|
||||||
if (!added) {
|
if (!added) {
|
||||||
/* File couldn't be opened, or is either not a NewGRF or is a
|
/* File couldn't be opened, or is either not a NewGRF or is a
|
||||||
* 'system' NewGRF or it's already known, so forget about it. */
|
* 'system' NewGRF or it's already known, so forget about it. */
|
||||||
free(c->filename);
|
free(c->filename);
|
||||||
free(c->name);
|
free(c->name);
|
||||||
free(c->info);
|
free(c->info);
|
||||||
|
|
Loading…
Reference in New Issue