Fixed missing failOnOverwrite check

This commit is contained in:
KevDi
2019-11-18 18:43:34 +01:00
parent 6c662bfb4a
commit 936441df93
2 changed files with 2 additions and 2 deletions

View File

@@ -386,7 +386,7 @@ void FileImpl::renameToImpl(const std::string& path, bool failOnOverwrite)
struct stat st; struct stat st;
if (stat(path.c_str(), &st) == 0) if (stat(path.c_str(), &st) == 0 && failOnOverwrite)
throw FileExistsException(path, EEXIST); throw FileExistsException(path, EEXIST);
if (rename(_path.c_str(), path.c_str()) != 0) if (rename(_path.c_str(), path.c_str()) != 0)

View File

@@ -288,7 +288,7 @@ void FileImpl::renameToImpl(const std::string& path, bool failOnOverwrite)
struct stat st; struct stat st;
if (stat(path.c_str(), &st) == 0) if (stat(path.c_str(), &st) == 0 && failOnOverwrite)
throw FileExistsException(path, EEXIST); throw FileExistsException(path, EEXIST);
if (rename(_path.c_str(), path.c_str()) != 0) if (rename(_path.c_str(), path.c_str()) != 0)