summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/ICQ-WIM/src/utils.cpp')
-rw-r--r--protocols/ICQ-WIM/src/utils.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp
index e11b1bb17c..2c36c3fb86 100644
--- a/protocols/ICQ-WIM/src/utils.cpp
+++ b/protocols/ICQ-WIM/src/utils.cpp
@@ -271,16 +271,21 @@ bool fileText2url(const CMStringW &wszText, CMStringW *res)
if (!mir_wstrncmp(wszText, L"https://files.icq.net/get/", 26)) {
if (res)
*res = wszText.Mid(26);
- return true;
}
-
- if (!mir_wstrncmp(wszText, L"http://files.icq.net/get/", 25)) {
+ else if (!mir_wstrncmp(wszText, L"http://files.icq.net/get/", 25)) {
if (res)
*res = wszText.Mid(25);
return true;
}
+ else return false;
+
+ if (res) {
+ int idx = res->FindOneOf(L" \r\n\t");
+ if (idx != -1)
+ *res = res->Mid(0, idx);
+ }
- return false;
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////////////