(_gpgme_map_gnupg_error): Handle numerical codes as

used by GnuPG 1.9.x
This commit is contained in:
Werner Koch 2004-01-16 15:47:27 +00:00
parent 8986b98063
commit 0c2e282d2f
3 changed files with 17 additions and 2 deletions

View File

@ -1,6 +1,11 @@
2004-01-16 Werner Koch <wk@gnupg.org>
* conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
used by GnuPG 1.9.x
2004-01-13 Marcus Brinkmann <marcus@g10code.de> 2004-01-13 Marcus Brinkmann <marcus@g10code.de>
* gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED> * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
2004-01-12 Werner Koch <wk@gnupg.org> 2004-01-12 Werner Koch <wk@gnupg.org>

View File

@ -393,6 +393,16 @@ _gpgme_map_gnupg_error (char *err)
{ {
unsigned int i; unsigned int i;
/* Future version of GnuPG might return the error code directly, so
we first test for a a numerical value and use that verbatim.
Note that this numerical value might be followed by an
udnerschore and the textual representation of the error code. */
if (*err >= '0' && *err <= '9')
return strtoul (err, NULL, 10);
/* Well, this is a token, use the mapping table to get the error.
The drawback is that we won't receive an error source and have to
use GPG as source. */
for (i = 0; i < DIM (gnupg_errors); i++) for (i = 0; i < DIM (gnupg_errors); i++)
if (!strcmp (gnupg_errors[i].name, err)) if (!strcmp (gnupg_errors[i].name, err))
return gpg_err_make (GPG_ERR_SOURCE_GPG, gnupg_errors[i].err); return gpg_err_make (GPG_ERR_SOURCE_GPG, gnupg_errors[i].err);

View File

@ -473,7 +473,7 @@ struct _gpgme_key_sig
{ {
struct _gpgme_key_sig *next; struct _gpgme_key_sig *next;
/* True if the signature is a revokation signature. */ /* True if the signature is a revocation signature. */
unsigned int revoked : 1; unsigned int revoked : 1;
/* True if the signature is expired. */ /* True if the signature is expired. */