diff options
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);
}
}
|