Changeset - r10775:904e49cf2a6f
[Not reviewed]
master
0 1 0
truebrain - 16 years ago 2009-01-16 14:56:33
truebrain@openttd.org
(svn r15108) -Fix: TarAddLink didn't lowercase strings, breaking tar-loading when using uppercase files
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/fileio.cpp
Show inline comments
 
@@ -472,14 +472,20 @@ const char *FioTarFirstDir(const char *t
 
{
 
	TarList::iterator it = _tar_list.find(tarname);
 
	if (it == _tar_list.end()) return NULL;
 
	return (*it).second.dirname;
 
}
 

	
 
static void TarAddLink(const std::string &src, const std::string &dest)
 
static void TarAddLink(const std::string &srcParam, const std::string &destParam)
 
{
 
	std::string src = srcParam;
 
	std::string dest = destParam;
 
	/* Tar internals assume lowercase */
 
	std::transform(src.begin(), src.end(), src.begin(), tolower);
 
	std::transform(dest.begin(), dest.end(), dest.begin(), tolower);
 

	
 
	TarFileList::iterator dest_file = _tar_filelist.find(dest);
 
	if (dest_file != _tar_filelist.end()) {
 
		/* Link to file. Process the link like the destination file. */
 
		_tar_filelist.insert(TarFileList::value_type(src, dest_file->second));
 
	} else {
 
		/* Destination file not found. Assume 'link to directory' */
0 comments (0 inline, 0 general)