diff options
author | George Hazan <ghazan@miranda.im> | 2020-09-14 15:06:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-09-14 15:06:17 +0300 |
commit | 03b1dc0ab84a0c28b5b330bb463d8cfe3e4c1445 (patch) | |
tree | 68f17f5c9d5122ccbe78eb4017e1e9e49938fc25 /plugins/PluginUpdater/src/Utils.cpp | |
parent | b5ce6f26e8b5389f2be2360509d336b539b65f56 (diff) |
Plugin Updater: if a file doesn't exist, there's no need to backup it
Diffstat (limited to 'plugins/PluginUpdater/src/Utils.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/Utils.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 8794b2b1e0..17fdd989bc 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -587,6 +587,9 @@ int SafeCreateFilePath(const wchar_t *pwszFolder) int BackupFile(wchar_t *pwszSrcFileName, wchar_t *pwszBackFileName)
{
+ if (_waccess(pwszSrcFileName, 0))
+ return 0;
+
SafeCreateFilePath(pwszBackFileName);
return SafeMoveFile(pwszSrcFileName, pwszBackFileName);
|