summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/pu_stub
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-08-27 21:26:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-08-27 21:26:06 +0300
commit4be5fbc996a104b1ec99327a2e46f45d1aaeb58f (patch)
tree9c2463031ef6c6957f6037e07bdf5a689d3f78e6 /plugins/PluginUpdater/pu_stub
parent3c74a59033f723e6c209284cbaed97425136c627 (diff)
Plugin Updater: more code cleaning
Diffstat (limited to 'plugins/PluginUpdater/pu_stub')
-rw-r--r--plugins/PluginUpdater/pu_stub/src/pu_stub.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp b/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp
index cca42b5c10..f93a07484d 100644
--- a/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp
+++ b/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp
@@ -85,13 +85,15 @@ int APIENTRY wWinMain(HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR lpCmdLine, int)
case 2: // move
if (!DeleteFileW(ptszFile2)) {
- dwError = GetLastError();
- if (dwError != ERROR_ACCESS_DENIED && dwError != ERROR_FILE_NOT_FOUND)
+ DWORD err = GetLastError();
+ if (err != ERROR_ACCESS_DENIED && err != ERROR_FILE_NOT_FOUND) {
+ dwError = err;
break;
+ }
}
if (!MoveFileW(ptszFile1, ptszFile2)) { // use copy on error
- switch (dwError = GetLastError()) {
+ switch (DWORD err = GetLastError()) {
case ERROR_ALREADY_EXISTS:
dwError = 0;
break; // this file was included into many archives, so Miranda tries to move it again & again
@@ -106,8 +108,10 @@ int APIENTRY wWinMain(HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR lpCmdLine, int)
if (!DeleteFileW(ptszFile1))
dwError = GetLastError();
+ break;
- dwError = 0;
+ default:
+ dwError = err;
break;
}
}