mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r15544) -Fix [FS#2650]: extracting downloaded content didn't work for Windows if one uses a non-ASCII.
This commit is contained in:
parent
38d66e69af
commit
fcdeb5c522
@ -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) {
|
||||||
@ -324,6 +325,7 @@ 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
Block a user