diff -r ee15b916f758 -r 1771ee81a39a src/newgrf_config.cpp --- a/src/newgrf_config.cpp Wed Apr 04 12:03:10 2007 +0000 +++ b/src/newgrf_config.cpp Wed Apr 04 12:43:43 2007 +0000 @@ -64,6 +64,10 @@ return false; } + if (config->filename == NULL) { + config->filename = strdup(strrchr(config->full_path, PATHSEPCHAR) + 1); + } + /* Find and load the Action 8 information */ /* 62 is the last file slot before sample.cat. * Should perhaps be some "don't care" value */ @@ -305,7 +309,6 @@ GRFConfig *c = CallocT(1); c->full_path = strdup(filename); - c->filename = strdup(strrchr(filename, PATHSEPCHAR) + 1); bool added = true; if (FillGRFDetails(c, false)) {