mirror of https://github.com/OpenTTD/OpenTTD
(svn r15544) -Fix [FS#2650]: extracting downloaded content didn't work for Windows if one uses a non-ASCII.
parent
a4567f243d
commit
fdc2e85184
|
@ -305,7 +305,8 @@ static bool GunzipFile(const ContentInfo *ci)
|
||||||
{
|
{
|
||||||
#if defined(WITH_ZLIB)
|
#if defined(WITH_ZLIB)
|
||||||
bool ret = true;
|
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");
|
FILE *fout = fopen(GetFullFilename(ci, false), "wb");
|
||||||
|
|
||||||
if (fin == NULL || fout == NULL) {
|
if (fin == NULL || fout == NULL) {
|
||||||
|
@ -323,7 +324,8 @@ static bool GunzipFile(const ContentInfo *ci)
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (fin != NULL) gzclose(fin);
|
if (fin != NULL) gzclose(fin);
|
||||||
|
if (ftmp != NULL) fclose(ftmp);
|
||||||
if (fout != NULL) fclose(fout);
|
if (fout != NULL) fclose(fout);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue