summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-02-21 14:00:35 +0000
committerrubidium <rubidium@openttd.org>2009-02-21 14:00:35 +0000
commitfdc2e851840f919f71b7cdad328511600c7fe535 (patch)
treed09756d66feeaf31e502a0317e4419dc02afaf6b /src
parenta4567f243d7bf2f13ac11a16c4fbb04cf5e2ba11 (diff)
downloadopenttd-fdc2e851840f919f71b7cdad328511600c7fe535.tar.xz
(svn r15544) -Fix [FS#2650]: extracting downloaded content didn't work for Windows if one uses a non-ASCII.
Diffstat (limited to 'src')
-rw-r--r--src/network/network_content.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp
index 6f918f2e3..7f6dd75ae 100644
--- a/src/network/network_content.cpp
+++ b/src/network/network_content.cpp
@@ -305,7 +305,8 @@ static bool GunzipFile(const ContentInfo *ci)
{
#if defined(WITH_ZLIB)
bool ret = true;
- gzFile fin = gzopen(GetFullFilename(ci, true), "rb");
+ FILE *ftmp = fopen(GetFullFilename(ci, true), "rb");
+ gzFile fin = gzdopen(fileno(ftmp), "rb");
FILE *fout = fopen(GetFullFilename(ci, false), "wb");
if (fin == NULL || fout == NULL) {
@@ -323,7 +324,8 @@ static bool GunzipFile(const ContentInfo *ci)
}
exit:
- if (fin != NULL) gzclose(fin);
+ if (fin != NULL) gzclose(fin);
+ if (ftmp != NULL) fclose(ftmp);
if (fout != NULL) fclose(fout);
return ret;