core: Check for gpg version for loopback mode
authorAndre Heinecke <aheinecke@intevation.de>
Tue, 6 Sep 2016 14:30:24 +0000 (16:30 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Tue, 6 Sep 2016 14:30:24 +0000 (16:30 +0200)
* src/engine-gpg.c (build_argv): Check for version 2.1.0
before adding pinentry-mode.

--
This is a compatibility fix for older versions that don't support
this flag which would otherwise result in an invalid argument
error.

src/engine-gpg.c

index 7036ee0..3f77ba8 100644 (file)
@@ -866,7 +866,7 @@ build_argv (engine_gpg_t gpg, const char *pgmname)
       argc++;
     }
 
-  if (gpg->pinentry_mode)
+  if (gpg->pinentry_mode && have_gpg_version (gpg, "2.1.0"))
     {
       const char *s = NULL;
       switch (gpg->pinentry_mode)