From e21fc45beaf3d6abcb012ffecb796e5053e8e5ac Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 14 Sep 2010 12:30:11 +0300 Subject: modified: gpg_wrapper.cpp modified: main.cpp modified: new_gpg.vcproj modified: options.cpp modified: utilities.cpp modified: utilities.h --- gpg_wrapper.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'gpg_wrapper.cpp') diff --git a/gpg_wrapper.cpp b/gpg_wrapper.cpp index 9c43777..dd8a65d 100644 --- a/gpg_wrapper.cpp +++ b/gpg_wrapper.cpp @@ -35,16 +35,6 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD unsigned long transfered; int size; - TCHAR *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", _T("")); - { - if(_waccess(bin_path, 0) == -1) - if(errno == ENOENT) - { - mir_free(bin_path); - *result = pxNotFound; - return pxNotFound; - } - } wstring commandline; sattrs.nLength=sizeof(SECURITY_ATTRIBUTES); @@ -76,11 +66,23 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD sinfo.hStdError=newstdout; sinfo.hStdInput=newstdin; + TCHAR *bin_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", _T("")); + { + if(_waccess(bin_path, 0) == -1) + { + if(errno == ENOENT) + { + mir_free(bin_path); + *result = pxNotFound; + return pxNotFound; + } + } + } + TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); { //form initial command commandline += _T("\""); commandline += bin_path; commandline += _T("\" --homedir \""); - TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); commandline += home_dir; commandline += _T("\" "); commandline += _T("--display-charset utf-8 "); -- cgit v1.2.3