diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-17 21:16:48 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-17 21:16:48 +0300 |
commit | f130a01e7db1ea976665612ebb4ec8cf8e12d9f0 (patch) | |
tree | 4cfb220c84ee287c2292d4f7468831b5beec3405 | |
parent | d51c050a305031806cf5a442ea7608f96353578d (diff) |
modified: main.cpp
modified: options.cpp
-rw-r--r-- | main.cpp | 13 | ||||
-rw-r--r-- | options.cpp | 38 |
2 files changed, 17 insertions, 34 deletions
@@ -1334,13 +1334,16 @@ void ImportKey() s2+=2; s = output.find("“", s2); if(s == string::npos) + { s = output.find("\"", s2); - s+=1; - if(s != s2-1) - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyType", output.substr(s2,s-s2).c_str()); - s+=2; + s += 1; + } + else + s += 3; if((s2 = output.find("(", s)) == string::npos) s2 = output.find("<", s); + else if(s2 > output.find("<", s)) + s2 = output.find("<", s); tmp = new char [output.substr(s,s2-s-1).length()+1]; strcpy(tmp, output.substr(s,s2-s-1).c_str()); mir_utf8decode(tmp, 0); @@ -1348,6 +1351,8 @@ void ImportKey() mir_free(tmp); if((s = output.find(")", s2)) == string::npos) s = output.find(">", s2); + else if(s > output.find(">", s2)) + s = output.find(">", s2); s2++; if(output[s] == ')') { diff --git a/options.cpp b/options.cpp index d0aadfc..dfbe50f 100644 --- a/options.cpp +++ b/options.cpp @@ -871,42 +871,18 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP if(hContact && hwndList_p) ListView_SetItemText(hwndList_p, item_num, 1, tmp); mir_free(tmp); - s2+=2; s = output.find("“", s2); if(s == string::npos) - s = output.find("\"", s2); - s+=1; - if(s != s2-1) { - tmp2 = new char [output.substr(s2,s-s2).length()+1]; - strcpy(tmp2, output.substr(s2,s-s2).c_str()); - mir_utf8decode(tmp2, 0); - if(hContact) - { - if(isProtoMetaContacts(hContact)) - { - HANDLE hcnt = NULL; - if(allsubcontacts) - { - int count = metaGetContactsNum(hContact); - for(int i = 0; i < count; i++) - { - hcnt = metaGetSubcontact(hContact, i); - if(hcnt) - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyType", output.substr(s2,s-s2).c_str()); - } - } - else - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyType", output.substr(s2,s-s2).c_str()); - } - else - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyType", output.substr(s2,s-s2).c_str()); - } - mir_free(tmp2); + s = output.find("\"", s2); + s += 1; } - s+=2; + else + s += 3; if((s2 = output.find("(", s)) == string::npos) s2 = output.find("<", s); + else if(s2 > output.find("<", s)) + s2 = output.find("<", s); tmp2 = new char [output.substr(s,s2-s-1).length()+1]; strcpy(tmp2, output.substr(s,s2-s-1).c_str()); mir_utf8decode(tmp2, 0); @@ -938,6 +914,8 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP mir_free(tmp); if((s = output.find(")", s2)) == string::npos) s = output.find(">", s2); + else if(s > output.find(">", s2)) + s = output.find(">", s2); s2++; if(output[s] == ')') { |