From fdc2e851840f919f71b7cdad328511600c7fe535 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 21 Feb 2009 14:00:35 +0000 Subject: (svn r15544) -Fix [FS#2650]: extracting downloaded content didn't work for Windows if one uses a non-ASCII. --- src/network/network_content.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/network/network_content.cpp') 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; -- cgit v1.2.3-70-g09d2