diff options
| author | Justus Winter <[email protected]> | 2016-05-10 11:03:34 +0000 | 
|---|---|---|
| committer | Justus Winter <[email protected]> | 2016-05-10 11:03:34 +0000 | 
| commit | f531608539b45f0bbd036f430943b390ec21aa65 (patch) | |
| tree | 56cf3f4db0c38e668645668ebb3dec418bed77a5 /src/delete.c | |
| parent | More GTK2 removal (diff) | |
| parent | Allow cc to detect missing cases in a switch. (diff) | |
| download | gpgme-f531608539b45f0bbd036f430943b390ec21aa65.tar.gz gpgme-f531608539b45f0bbd036f430943b390ec21aa65.zip | |
Merge branch 'master' into justus/pyme3
Diffstat (limited to 'src/delete.c')
| -rw-r--r-- | src/delete.c | 36 | 
1 files changed, 34 insertions, 2 deletions
| diff --git a/src/delete.c b/src/delete.c index 37e54f89..d7fdf50f 100644 --- a/src/delete.c +++ b/src/delete.c @@ -64,8 +64,40 @@ delete_status_handler (void *priv, gpgme_status_code_t code, char *args)  	case DELETE_Ambiguous_Specification:  	  return gpg_error (GPG_ERR_AMBIGUOUS_NAME); -	default: -	  return gpg_error (GPG_ERR_GENERAL); +	} + +      return gpg_error (GPG_ERR_GENERAL); +    } +  else if (code == GPGME_STATUS_ERROR) +    { +      /* Some error stati are informational, so we don't return an +         error code if we are not ready to process this status.  */ +      gpgme_error_t err; +      char *where = strchr (args, ' '); +      char *which; + +      if (where) +	{ +	  *where = '\0'; +	  which = where + 1; + +	  where = strchr (which, ' '); +	  if (where) +	    *where = '\0'; + +	  where = args; +	} +      else +	return trace_gpg_error (GPG_ERR_INV_ENGINE); + +      err = atoi (which); + +      if (!strcmp (where, "delete_key.secret") +	  && (gpg_err_code (err) == GPG_ERR_CANCELED +	      || gpg_err_code (err) == GPG_ERR_FULLY_CANCELED)) +	{ +	  /* This indicates a user cancellation on the confirmation dialog.  */ +	  return gpg_error (gpg_err_code (err));  	}      }    return 0; | 
