diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-31 07:57:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-31 07:57:03 +0000 |
commit | 34572133dc4f3b86f9a3cb9708aa0806f1cfded2 (patch) | |
tree | 2bed7c078dd39e6f45287302501332596525f309 /protocols/JabberG/src/jabber.cpp | |
parent | f6eb47ba8c15005c274a98ab238dafc3f9676c6d (diff) |
fix for the temporary file types
git-svn-id: http://svn.miranda-ng.org/main/trunk@13927 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index a309320cb7..92b8c8872f 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -235,11 +235,19 @@ extern "C" int __declspec(dllexport) Unload(void) DestroyHookableEvent(hDiscoInfoResult);
if (g_nTempFileId != 0) {
- TCHAR tszTempPath[MAX_PATH], tszTempFile[MAX_PATH];
+ TCHAR tszTempPath[MAX_PATH], tszFilePath[MAX_PATH];
GetTempPath(_countof(tszTempPath), tszTempPath);
- for (unsigned i = 1; i <= g_nTempFileId; i++) {
- GetTempFileName(tszTempPath, _T("jab"), i, tszTempFile);
- DeleteFile(tszTempFile);
+ mir_sntprintf(tszFilePath, _countof(tszFilePath), _T("%sjab*.tmp.*"), tszTempPath);
+
+ WIN32_FIND_DATA findData;
+ HANDLE hFind = FindFirstFile(tszFilePath, &findData);
+ if (hFind != INVALID_HANDLE_VALUE) {
+ do {
+ mir_sntprintf(tszFilePath, _countof(tszFilePath), _T("%s%s"), tszTempPath, findData.cFileName);
+ DeleteFile(tszFilePath);
+ } while (FindNextFile(hFind, &findData));
+
+ FindClose(hFind);
}
}
|