From 27a2f481b12271ad9eac3f8f29ddc6cf06c0e69c Mon Sep 17 00:00:00 2001 From: Alexander Gluzsky Date: Tue, 4 Feb 2014 20:46:19 +0000 Subject: better check for gnupg.exe binary git-svn-id: http://svn.miranda-ng.org/main/trunk@8039 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/utilities.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'plugins/New_GPG/src') diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 1e758bf53d..d89a0003b7 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -1132,7 +1132,9 @@ bool isGPGValid() TCHAR *tmp = NULL; bool gpg_exists = false, is_valid = true; tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", _T("")); - if(_waccess(tmp, 0) != -1) + boost::filesystem::path p(tmp); + + if(boost::filesystem::exists(p) && boost::filesystem::is_regular_file(p)) gpg_exists = true; else { @@ -1150,7 +1152,8 @@ bool isGPGValid() _tcscat(gpg_path, _T("\\GnuPG\\gpg.exe")); mir_free(tmp); tmp = NULL; - if(_waccess(gpg_path, 0) != -1) + p = boost::filesystem::path(gpg_path); + if(boost::filesystem::exists(p) && boost::filesystem::is_regular_file(p)) { gpg_exists = true; _tcscpy(path, _T("GnuPG\\gpg.exe")); @@ -1194,7 +1197,7 @@ bool isGPGValid() } if(tmp) mir_free(tmp); */ - return is_valid; + return is_valid && is_valid; } #define NEWTSTR_MALLOC(A) (A==NULL)?NULL:strcpy((char*)mir_alloc(sizeof(char)*(strlen(A)+1)),A) -- cgit v1.2.3