diff options
author | George Hazan <ghazan@miranda.im> | 2020-08-27 21:26:06 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-08-27 21:26:06 +0300 |
commit | 4be5fbc996a104b1ec99327a2e46f45d1aaeb58f (patch) | |
tree | 9c2463031ef6c6957f6037e07bdf5a689d3f78e6 /plugins/PluginUpdater/pu_stub | |
parent | 3c74a59033f723e6c209284cbaed97425136c627 (diff) |
Plugin Updater: more code cleaning
Diffstat (limited to 'plugins/PluginUpdater/pu_stub')
-rw-r--r-- | plugins/PluginUpdater/pu_stub/src/pu_stub.cpp | 12 |
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; } } |