From: Daniel F. <df...@us...> - 2004-12-15 09:28:01
|
Update of /cvsroot/planeshift/planeshift/src/updater In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2555/src/updater Modified Files: download.cpp Log Message: Updater fix for Mac OS X Index: download.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/updater/download.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** download.cpp 25 Oct 2004 15:19:30 -0000 1.6 --- download.cpp 15 Dec 2004 09:27:53 -0000 1.7 *************** *** 90,100 **** bool doprogress) { ! // Set passwords curl_easy_setopt (curl, CURLOPT_USERPWD,psupdaterengine->GetUpdater()->GetConfig()->GetMirror()->passphrase.GetData()); FILE* file; ! file = fopen (dest, "wb"); ! if (!file) { --- 90,112 ---- bool doprogress) { ! char * destpath; // Set passwords curl_easy_setopt (curl, CURLOPT_USERPWD,psupdaterengine->GetUpdater()->GetConfig()->GetMirror()->passphrase.GetData()); + csRef<iVFS> vfs = eng->GetVFS(); + if (vfs){ + csRef<iDataBuffer> prefixpath = vfs->GetRealPath("/this/"); + destpath = malloc(strlen(dest) + prefixpath->GetSize()+1); //not sure if the +1 is necessary, but paranoid. + strncpy(destpath,prefixpath->GetData(),prefixpath->GetSize()); + strcat(destpath,dest); + } + else + { + printf("No VFS in object registry!?\n"); + return false; + } FILE* file; ! file = fopen (destpath, "wb"); ! if (!file) { *************** *** 116,120 **** fclose (file); ! long curlhttpcode; curl_easy_getinfo (curl, CURLINFO_HTTP_CODE, &curlhttpcode); --- 128,134 ---- fclose (file); ! free(destpath); ! destpath = 0; ! long curlhttpcode; curl_easy_getinfo (curl, CURLINFO_HTTP_CODE, &curlhttpcode); |