Bit more verbose. Also ensures that the location actually exists.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4311 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2013-04-11 10:34:06 +00:00
parent 292f61c6e0
commit a141f45715
1 changed files with 19 additions and 16 deletions

View File

@ -2152,6 +2152,21 @@ qboolean Update_GetHomeDirectory(char *homedir, int homedirsize)
return false;
}
static void Update_CreatePath (char *path)
{
char *ofs;
for (ofs = path+1 ; *ofs ; ofs++)
{
if (*ofs == '/')
{ // create the directory
*ofs = 0;
Sys_mkdir (path);
*ofs = '/';
}
}
}
#include "fs.h"
void Update_Version_Updated(struct dl_download *dl)
{
@ -2166,8 +2181,11 @@ void Update_Version_Updated(struct dl_download *dl)
vfsfile_t *pending;
Update_GetHomeDirectory(pendingname, sizeof(pendingname));
Q_strncatz(pendingname, DISTRIBUTION BUILDTYPE EXETYPE".tmp", sizeof(pendingname));
Update_CreatePath(pendingname);
pending = VFSOS_Open(pendingname, "wb");
if (pending)
if (!pending)
Con_Printf("Unable to write to \"%s\"\n", pendingname);
else
{
while(1)
{
@ -2226,21 +2244,6 @@ void Update_Check(void)
}
}
static void Update_CreatePath (char *path)
{
char *ofs;
for (ofs = path+1 ; *ofs ; ofs++)
{
if (*ofs == '/')
{ // create the directory
*ofs = 0;
Sys_mkdir (path);
*ofs = '/';
}
}
}
qboolean Sys_CheckUpdated(void)
{
int ffe = COM_CheckParm("--fromfrontend");