7222860
From b99502274ae5efdf6df0d967900ec3d1e64373d7 Mon Sep 17 00:00:00 2001
7222860
From: Werner Koch <wk@gnupg.org>
7222860
Date: Thu, 12 Apr 2018 20:36:30 +0200
7222860
Subject: [PATCH] core: Tweak STATUS_FAILURE handling.
7222860
7222860
* src/op-support.c (_gpgme_parse_failure): Ignore failures with
7222860
location "gpg-exit".
7222860
* tests/gpg/t-verify.c (main): Adjust for the now working checking of
7222860
the second key.
7222860
7222860
Signed-off-by: Werner Koch <wk@gnupg.org>
7222860
---
7222860
 src/op-support.c     | 10 +++++++++-
7222860
 tests/gpg/t-verify.c |  8 +++++---
7222860
 2 files changed, 14 insertions(+), 4 deletions(-)
7222860
7222860
diff --git a/src/op-support.c b/src/op-support.c
7222860
index 43cb1c76..e55875f9 100644
7222860
--- a/src/op-support.c
7222860
+++ b/src/op-support.c
7222860
@@ -400,7 +400,13 @@ _gpgme_parse_plaintext (char *args, char **filenamep)
7222860
 
7222860
 
7222860
 /* Parse a FAILURE status line and return the error code.  ARGS is
7222860
-   modified to contain the location part.  */
7222860
+ * modified to contain the location part.  Note that for now we ignore
7222860
+ * failure codes with a location of gpg-exit; they are too trouble
7222860
+ * some.  Instead we should eventually record that error in the
7222860
+ * context and provide a function to return a fuller error
7222860
+ * description; this could then also show the location of the error
7222860
+ * (e.g. "option- parser") to make it easier for the user to detect
7222860
+ * the actual error. */
7222860
 gpgme_error_t
7222860
 _gpgme_parse_failure (char *args)
7222860
 {
7222860
@@ -418,6 +424,8 @@ _gpgme_parse_failure (char *args)
7222860
     *where = '\0';
7222860
 
7222860
   where = args;
7222860
+  if (!strcmp (where, "gpg-exit"))
7222860
+    return 0;
7222860
 
7222860
   return atoi (which);
7222860
 }
7222860
-- 
7222860
2.14.3
7222860