Changeset - r16511:ee224126d104
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-11-18 22:26:29
rubidium@openttd.org
(svn r21247) -Fix: make the tar scanner forget about old (possibly removed) tars
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/fileio.cpp
Show inline comments
 
@@ -534,25 +534,29 @@ void FioTarAddLink(const char *src, cons
 
 */
 
static void SimplifyFileName(char *name)
 
{
 
	/* Force lowercase */
 
	strtolower(name);
 

	
 
	/* Tar-files always have '/' path-seperator, but we want our PATHSEPCHAR */
 
#if (PATHSEPCHAR != '/')
 
	for (char *n = name; *n != '\0'; n++) if (*n == '/') *n = PATHSEPCHAR;
 
#endif
 
}
 

	
 
/* static */ uint TarScanner::DoScan() {
 
/* static */ uint TarScanner::DoScan()
 
{
 
	_tar_filelist.clear();
 
	_tar_list.clear();
 

	
 
	DEBUG(misc, 1, "Scanning for tars");
 
	TarScanner fs;
 
	uint num = fs.Scan(".tar", DATA_DIR, false);
 
	num += fs.Scan(".tar", AI_DIR, false);
 
	num += fs.Scan(".tar", AI_LIBRARY_DIR, false);
 
	num += fs.Scan(".tar", SCENARIO_DIR, false);
 
	DEBUG(misc, 1, "Scan complete, found %d files", num);
 
	return num;
 
}
 

	
 
bool TarScanner::AddFile(const char *filename, size_t basepath_length)
 
{
0 comments (0 inline, 0 general)