summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-08-28 01:01:27 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-08-28 01:01:27 +0300
commit634d16d7a56e8ba72fda7b6f1896970b96b331ff (patch)
tree35cee2ef3351ae607fa7196413626badcf0c92a7
parent26f425f0153de537bc676c9c38a68ef3edd882c5 (diff)
fixed crash when loading existing secret key
-rw-r--r--new_gpg.rc6
-rw-r--r--options.cpp7
2 files changed, 10 insertions, 3 deletions
diff --git a/new_gpg.rc b/new_gpg.rc
index 1ec3e23..7f5117c 100644
--- a/new_gpg.rc
+++ b/new_gpg.rc
@@ -71,12 +71,12 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "خت",ID_OK,12,175,50,14,WS_DISABLED
CONTROL "",IDC_KEY_LIST,"SysListView32",LVS_REPORT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,23,277,105
- PUSHBUTTON "Generate key",IDC_GENERATE_KEY,11,131,54,14
+ PUSHBUTTON "Generate key",IDC_GENERATE_KEY,11,131,58,14
LTEXT "Select key for use",IDC_STATIC,16,12,186,8
EDITTEXT IDC_KEY_PASSWORD,94,147,77,14,ES_PASSWORD | ES_AUTOHSCROLL
RTEXT "Key password:",IDC_STATIC,12,149,76,8
- PUSHBUTTON "Load other",IDC_OTHER,68,131,50,14
- PUSHBUTTON "Delete key",IDC_DELETE_KEY,121,131,46,14
+ PUSHBUTTON "Load other",IDC_OTHER,73,131,56,14
+ PUSHBUTTON "Delete key",IDC_DELETE_KEY,132,131,56,14
END
IDD_BIN_PATH DIALOGEX 0, 0, 354, 89
diff --git a/options.cpp b/options.cpp
index f902d59..9d9b952 100644
--- a/options.cpp
+++ b/options.cpp
@@ -625,6 +625,13 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP
DBDeleteContactSetting(user_data[item_num+1], szGPGModuleName, "bAlwatsTrust");
{
TCHAR *tmp;
+
+ if(output.find("already in secret keyring") != string::npos)
+ {
+ MessageBox(0, _T("Key already in scret key ring."), _T("Info"), MB_OK);
+ DeleteFile(tmp2);
+ break;
+ }
char *tmp2;
string::size_type s = output.find("gpg: key ") + strlen("gpg: key ");
string::size_type s2 = output.find(":", s);