[git] GpgOL - branch, master, updated. gpgol-1.4.0-160-g5888d6d

by Andre Heinecke cvs at cvs.gnupg.org
Mon Nov 14 11:05:19 CET 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, master has been updated
       via  5888d6dcebc5c3e426db597d9d9ecd9c78051a45 (commit)
      from  74a291515bcfbf3c679e129d4a46d82e12d95319 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5888d6dcebc5c3e426db597d9d9ecd9c78051a45
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Nov 14 11:03:36 2016 +0100

    Make gpgme install dir selection more flexible
    
    * src/main.c (get_gpgme_w32_inst_dir): New.
    (DllMain): Use it.
    
    --
    This makes the w32-inst-dir finding work with gpg4win-2 where
    gpg-w32-spawn is not in the bin dir.

diff --git a/src/main.c b/src/main.c
index ba379a2..bec5f9f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,6 +23,7 @@
 #include <wincrypt.h>
 #include <ctype.h>
 #include <winnls.h>
+#include <unistd.h>
 
 #include "mymapi.h"
 #include "mymapitags.h"
@@ -142,6 +143,32 @@ i18n_init (void)
   textdomain (PACKAGE_GT);
 }
 
+static char *
+get_gpgme_w32_inst_dir (void)
+{
+  char *gpg4win_dir = get_gpg4win_dir ();
+  char *tmp;
+  gpgrt_asprintf (&tmp, "%s\\bin\\gpgme-w32-spawn.exe", gpg4win_dir);
+
+  if (!access(tmp, R_OK))
+    {
+      xfree (tmp);
+      gpgrt_asprintf (&tmp, "%s\\bin", gpg4win_dir);
+      xfree (gpg4win_dir);
+      return tmp;
+    }
+  xfree (tmp);
+  gpgrt_asprintf (&tmp, "%s\\gpgme-w32-spawn.exe", gpg4win_dir);
+
+  if (!access(tmp, R_OK))
+    {
+      xfree (tmp);
+      return gpg4win_dir;
+    }
+  log_error("%s:%s: Failed to find gpgme-w32-spawn.exe!",
+            SRCNAME, __func__);
+  return NULL;
+}
 
 /* Entry point called by DLL loader. */
 int WINAPI
@@ -157,8 +184,7 @@ DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
 
       /* Set the installation directory for GpgME so that
          it can find tools like gpgme-w32-spawn correctly. */
-      char *instdir;
-      gpgrt_asprintf (&instdir, "%s\\bin", get_gpg4win_dir ());
+      char *instdir = get_gpgme_w32_inst_dir();
       gpgme_set_global_flag ("w32-inst-dir", instdir);
       xfree (instdir);
 

-----------------------------------------------------------------------

Summary of changes:
 src/main.c | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list