From 495060a525513654e6d5ab39f24571c053b3b67b Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sun, 5 Sep 2010 22:09:13 +0300 Subject: modified: gpg_wrapper.cpp modified: main.cpp modified: options.cpp modified: utilities.cpp --- main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index b11b969..f4f4e00 100644 --- a/main.cpp +++ b/main.cpp @@ -173,9 +173,9 @@ static BOOL CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM } string out; DWORD code; - wstring cmd = _T("--batch -a --export \""); - cmd += name; - cmd += _T("\""); + wstring cmd = _T("--batch -a --export "); + cmd += fp; +// cmd += _T("\""); gpg_execution_params params; pxResult result; params.cmd = &cmd; @@ -1175,6 +1175,7 @@ void ImportKey() HANDLE hContact = new_key_hcnt; ReleaseMutex(new_key_hcnt_mutex); DBWriteContactSettingTString(hContact, szGPGModuleName, "GPGPubKey", new_key.c_str()); + new_key.clear(); { //gpg execute block wstring cmd; TCHAR tmp2[MAX_PATH] = {0}; @@ -1187,6 +1188,7 @@ void ImportKey() mir_free(ptmp); _tcscat(tmp2, _T("\\")); _tcscat(tmp2, _T("temporary_exported.asc")); + DeleteFile(tmp2); wfstream f(tmp2, std::ios::out); ptmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); wstring new_key = ptmp; @@ -1223,7 +1225,7 @@ void ImportKey() string::size_type s2 = output.find(":", s); DBWriteContactSettingString(hContact, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str()); s2+=2; - s = output.find("\"", s2)-1; + s = output.find("“", s2)+1; if(s != s2-1) DBWriteContactSettingString(hContact, szGPGModuleName, "KeyType", output.substr(s2,s-s2).c_str()); s+=2; -- cgit v1.2.3