diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2016-04-15 18:29:35 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2016-04-15 18:29:35 +0000 |
commit | 01f01c04263bae7f66e191976f45b5e03487a935 (patch) | |
tree | 4ef1276a4c13b411a8447e29243c7c01df2e4da9 /plugins/PluginUpdater/src/DlgUpdate.cpp | |
parent | a2815e07fd20b5ac71c85df4a3707174a05ab628 (diff) |
PluginUpdater:
- Fixed updating
git-svn-id: http://svn.miranda-ng.org/main/trunk@16666 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/DlgUpdate.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/DlgUpdate.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 701aed3927..542f5fd9b2 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -567,6 +567,8 @@ static renameTable[] = { _T("WART-*.exe"), NULL },
};
+// Checks if file needs to be renamed and copies it in pNewName
+// Returns true if smth. was copied
static bool CheckFileRename(const TCHAR *ptszOldName, TCHAR *pNewName)
{
for (int i = 0; i < _countof(renameTable); i++) {
@@ -627,16 +629,12 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, const TCHAR *tsz else if (isValidExtension(ffd.cFileName)) {
// calculate the current file's relative name and store it into tszNewName
TCHAR tszNewName[MAX_PATH];
- if (!CheckFileRename(ffd.cFileName, tszNewName)) {
- if (level == 0) {
- if (opts.bChangePlatform) {
- if (!mir_tstrcmpi(ffd.cFileName, _T("miranda32.exe")))
- _tcsncpy_s(tszNewName, _T("miranda64.exe"), _TRUNCATE);
- if (!mir_tstrcmpi(ffd.cFileName, _T("miranda64.exe")))
- _tcsncpy_s(tszNewName, _T("miranda32.exe"), _TRUNCATE);
- }
- _tcsncpy_s(tszNewName, ffd.cFileName, _TRUNCATE);
- }
+ if (CheckFileRename(ffd.cFileName, tszNewName))
+ Netlib_LogfT(hNetlibUser, _T("File %s will be renamed to %s."), ffd.cFileName, tszNewName);
+ else {
+ if (level == 0)
+ // Rename Miranda*.exe
+ _tcsncpy_s(tszNewName, opts.bChangePlatform && !mir_tstrcmp(ffd.cFileName, OLD_FILENAME) ? NEW_FILENAME : ffd.cFileName, _TRUNCATE);
else
mir_sntprintf(tszNewName, _T("%s\\%s"), tszFolder + cbBaseLen, ffd.cFileName);
}
|