diff options
author | rubidium <rubidium@openttd.org> | 2009-02-21 14:00:35 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-02-21 14:00:35 +0000 |
commit | fcdeb5c52237cee2d25e6072af3f2d4c28b057ee (patch) | |
tree | d09756d66feeaf31e502a0317e4419dc02afaf6b /src/network | |
parent | 38d66e69aff6a44a38aed486b6b30769d6611022 (diff) | |
download | openttd-fcdeb5c52237cee2d25e6072af3f2d4c28b057ee.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/network')
-rw-r--r-- | src/network/network_content.cpp | 6 |
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; |