Merge branch 'master' of ssh://gitweb/git/desktop/standalone-updater

This commit is contained in:
Robert Knight 2011-09-16 15:45:41 +01:00
commit 61e8c92550
4 changed files with 27 additions and 3 deletions

View file

@ -298,7 +298,16 @@ std::string FileUtils::fileName(const char* path)
#else
char baseName[MAX_PATH];
char extension[MAX_PATH];
_splitpath(path, 0 /* drive */, 0 /* dir */, baseName, extension);
_splitpath_s(path,
0, /* drive */
0, /* drive length */
0, /* dir */
0, /* dir length */
baseName,
MAX_PATH, /* baseName length */
extension,
MAX_PATH /* extension length */
);
return std::string(baseName) + std::string(extension);
#endif
}
@ -312,7 +321,16 @@ std::string FileUtils::dirname(const char* path)
return dirname;
#else
char dir[MAX_PATH];
_splitpath(path, 0 /* drive */, dir, 0 /* filename */, 0/* extension */);
_splitpath_s(path,
0, /* drive */
0, /* drive length */
dir,
MAX_PATH, /* dir length */
0, /* filename */
0, /* filename length */
0, /* extension */
0 /* extension length */
);
return std::string(dir);
#endif
}

View file

@ -3,8 +3,10 @@
#include <exception>
#include <string>
#include "Platform.h"
#include "StringUtils.h"
/** A set of functions for performing common operations
* on files, throwing exceptions if an operation fails.
*

View file

@ -8,6 +8,10 @@
#ifdef WIN32
#define PLATFORM_WINDOWS
#include <windows.h>
// disable warnings about exception specifications,
// which are not implemented in Visual C++
#pragma warning(disable:4290)
#endif
#ifdef __APPLE__

View file

@ -115,7 +115,7 @@ void UpdateInstaller::run() throw ()
{
updaterPath = ProcessUtils::currentProcessPath();
}
catch (const FileUtils::IOException& ex)
catch (const FileUtils::IOException&)
{
LOG(Error,"error reading process path with mode " + intToStr(m_mode));
reportError("Unable to determine path of updater");