diff options
author | truebrain <truebrain@openttd.org> | 2009-01-16 14:56:33 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2009-01-16 14:56:33 +0000 |
commit | a43cd3456b040e3c70c7629372d4a998ce33f997 (patch) | |
tree | b1300b474af18868f805b08034bb561a52cb6dc4 | |
parent | 7f851eaeb908637689dbae9c408ece765a01b7a8 (diff) | |
download | openttd-a43cd3456b040e3c70c7629372d4a998ce33f997.tar.xz |
(svn r15108) -Fix: TarAddLink didn't lowercase strings, breaking tar-loading when using uppercase files
-rw-r--r-- | src/fileio.cpp | 8 |
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. */ |