summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp10
1 files changed, 6 insertions, 4 deletions
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;