From: <mg...@us...> - 2008-06-14 12:05:59
|
Revision: 1758 http://planeshift.svn.sourceforge.net/planeshift/?rev=1758&view=rev Author: mgist Date: 2008-06-14 05:06:05 -0700 (Sat, 14 Jun 2008) Log Message: ----------- - Merged r1757 from trunk. Modified Paths: -------------- stable/docs/history.txt stable/src/common/util/fileutil.cpp Modified: stable/docs/history.txt =================================================================== --- stable/docs/history.txt 2008-06-14 12:04:16 UTC (rev 1757) +++ stable/docs/history.txt 2008-06-14 12:06:05 UTC (rev 1758) @@ -1,3 +1,6 @@ +*** 2008-06-14 by Mike Gist +- Fixed permissions bugs in the updater. + *** 2008-06-14 by Kenny Graunke - Commit patch for part of FS#74. Modified: stable/src/common/util/fileutil.cpp =================================================================== --- stable/src/common/util/fileutil.cpp 2008-06-14 12:04:16 UTC (rev 1757) +++ stable/src/common/util/fileutil.cpp 2008-06-14 12:06:05 UTC (rev 1758) @@ -98,13 +98,17 @@ void FileUtil::MakeDirectory (const char* directory) { - csRef<iDataBuffer> realPath = vfs->GetRealPath(directory); - while(!vfs->Exists(directory)) + csString dirAppended(directory); + dirAppended.Append("/"); + + csRef<iDataBuffer> realPath = vfs->GetRealPath(dirAppended); + while(!vfs->Exists(dirAppended)) { + #ifdef CS_PLATFORM_WIN32 - int rc = mkdir(realPath->GetData()); + int rc = mkdir(realPath->GetData()); #else - int rc = mkdir(realPath->GetData(), S_IRUSR | S_IWUSR); + int rc = mkdir(realPath->GetData(), S_IRUSR | S_IWUSR); #endif csString dir = directory; @@ -119,7 +123,7 @@ return; } - real = vfs->GetRealPath(dir); + real = vfs->GetRealPath(dir + "/"); #ifdef CS_PLATFORM_WIN32 rc = mkdir(real->GetData()); #else @@ -129,7 +133,7 @@ #ifdef CS_PLATFORM_UNIX dir.Truncate(dir.FindLast('/')); - csRef<iDataBuffer> parent = vfs->GetRealPath(dir); + csRef<iDataBuffer> parent = vfs->GetRealPath(dir + "/"); csRef<FileStat> dirStat = StatFile(parent->GetData()); SetPermissions(real->GetData(), dirStat); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |