Commit 44542cbc authored by Gerhard Stein's avatar Gerhard Stein

Do not extract in another subdirectory

parent 084d293c
......@@ -331,7 +331,6 @@ int GameDownloader::handle()
// Go through the missing pieces
const auto &gameFileName = mGameFileName;
const auto &gameName = mGameName;
{
gDlfrom = mProgress = 0;
gDlto = 900;
......@@ -350,12 +349,10 @@ int GameDownloader::handle()
// TODO: Now the downloaded stuff must be extracted to the games directory
// At this point the file should be available
const std::string destDir = JoinPaths(gamesPath, gameName);
const std::string destDir = gamesPath;
if( IsFileAvailable(downloadGamePath) )
{
// Create subdirectory
CreateRecDir( destDir );
// Try to unzip the files
const std::string fullZipPath = JoinPaths(fullDownloadPath, gameFileName);
const int retVal = unzipFile(fullZipPath.c_str(), destDir.c_str());
......
......@@ -546,14 +546,13 @@ int unzipFile(const char *input,
opt_do_extract = 1;
opt_extractdir = 1;
if (zipfilename!=NULL)
if (zipfilename != nullptr)
{
# ifdef USEWIN32IOAPI
zlib_filefunc64_def ffunc;
# endif
strncpy(filename_try, zipfilename,MAXFILENAME-1);
strncpy(filename_try, zipfilename, MAXFILENAME-1);
/* strncpy doesnt append the trailing NULL, of the string is too long. */
filename_try[ MAXFILENAME ] = '\0';
......@@ -563,7 +562,7 @@ int unzipFile(const char *input,
# else
uf = unzOpen64(zipfilename);
# endif
if (uf==NULL)
if (uf==nullptr)
{
strcat(filename_try,".zip");
# ifdef USEWIN32IOAPI
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment