summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-09-14 15:06:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-09-14 15:06:17 +0300
commit03b1dc0ab84a0c28b5b330bb463d8cfe3e4c1445 (patch)
tree68f17f5c9d5122ccbe78eb4017e1e9e49938fc25 /plugins/PluginUpdater/src/Utils.cpp
parentb5ce6f26e8b5389f2be2360509d336b539b65f56 (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.cpp3
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);