summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAlexander Gluzsky <sss123next@list.ru>2014-02-04 20:46:19 +0000
committerAlexander Gluzsky <sss123next@list.ru>2014-02-04 20:46:19 +0000
commit27a2f481b12271ad9eac3f8f29ddc6cf06c0e69c (patch)
tree13f65bc148e507b07f36b0d236bdb3e9338bd537 /plugins
parent485b2da13ec091ec7fd39bba8f05cb177d1bdd0b (diff)
better check for gnupg.exe binary
git-svn-id: http://svn.miranda-ng.org/main/trunk@8039 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp9
1 files changed, 6 insertions, 3 deletions
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)