summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2009-01-16 14:56:33 +0000
committertruebrain <truebrain@openttd.org>2009-01-16 14:56:33 +0000
commit47406dbc696fc0630e3801080d0c2d491f404f24 (patch)
treeb1300b474af18868f805b08034bb561a52cb6dc4 /src
parentf5e0590c09301a82288acd2fb0e35c7098f2637b (diff)
downloadopenttd-47406dbc696fc0630e3801080d0c2d491f404f24.tar.xz
(svn r15108) -Fix: TarAddLink didn't lowercase strings, breaking tar-loading when using uppercase files
Diffstat (limited to 'src')
-rw-r--r--src/fileio.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index fee63fd08..fc60dfebe 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -475,8 +475,14 @@ const char *FioTarFirstDir(const char *tarname)
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. */