summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpg_wrapper.cpp3
-rw-r--r--main.cpp10
-rw-r--r--options.cpp3
-rw-r--r--utilities.cpp4
4 files changed, 10 insertions, 10 deletions
diff --git a/gpg_wrapper.cpp b/gpg_wrapper.cpp
index df3e1fa..9c43777 100644
--- a/gpg_wrapper.cpp
+++ b/gpg_wrapper.cpp
@@ -93,8 +93,7 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD
gpg_mutex = CreateMutex(NULL, FALSE, NULL);
- setlocale( LC_ALL, "C" );
- success = CreateProcess(NULL, (TCHAR*)commandline.c_str(), NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &sinfo, &pri);
+ success = CreateProcess(NULL, (TCHAR*)commandline.c_str(), NULL, NULL, TRUE, CREATE_NEW_CONSOLE | CREATE_UNICODE_ENVIRONMENT, _T("LANGUAGE=en@quot\0"), NULL, &sinfo, &pri);
if (!success)
{
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;
diff --git a/options.cpp b/options.cpp
index 0c19b60..00b4b7e 100644
--- a/options.cpp
+++ b/options.cpp
@@ -683,6 +683,7 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP
mir_free(ptmp);
_tcscat(tmp2, _T("\\"));
_tcscat(tmp2, _T("temporary_exported.asc"));
+ DeleteFile(tmp2);
wfstream f(tmp2, std::ios::out);
ptmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "GPGPubKey", _T(""));
wstring str = ptmp;
@@ -780,7 +781,7 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP
ListView_SetItemText(hwndList_p, item_num, 1, tmp);
mir_free(tmp);
s2+=2;
- s = output.find("\"", s2)-1;
+ s = output.find("“", s2)+1;
if(s != s2-1)
{
tmp2 = new char [output.substr(s2,s-s2).length()+1];
diff --git a/utilities.cpp b/utilities.cpp
index 5f1ad0a..8320d93 100644
--- a/utilities.cpp
+++ b/utilities.cpp
@@ -403,9 +403,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU
wstring path_out = path_c;
mir_free(path_c);
path_out += _T("\\prescense_text");
- {
- DeleteFile(path_out.c_str());
- }
+ DeleteFile(path_out.c_str());
wfstream f(path_out.c_str(), std::ios::out);
char *tmp = mir_utf8encodeW(str);
f<<tmp;