aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-01-16 15:47:27 +0000
committerWerner Koch <[email protected]>2004-01-16 15:47:27 +0000
commit0c2e282d2f6981f7b46a2d65e693ba5586b64926 (patch)
tree4861a0fcb0426b178663f50df15bc5aac6a2bb35
parentAdd note about key signature notations. (diff)
downloadgpgme-0c2e282d2f6981f7b46a2d65e693ba5586b64926.tar.gz
gpgme-0c2e282d2f6981f7b46a2d65e693ba5586b64926.zip
(_gpgme_map_gnupg_error): Handle numerical codes as
used by GnuPG 1.9.x
Diffstat (limited to '')
-rw-r--r--gpgme/ChangeLog7
-rw-r--r--gpgme/conversion.c10
-rw-r--r--gpgme/gpgme.h2
3 files changed, 17 insertions, 2 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog
index 923166f8..a9703b7d 100644
--- a/gpgme/ChangeLog
+++ b/gpgme/ChangeLog
@@ -1,6 +1,11 @@
+2004-01-16 Werner Koch <[email protected]>
+
+ * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
+ used by GnuPG 1.9.x
+
2004-01-13 Marcus Brinkmann <[email protected]>
- * 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 <[email protected]>
diff --git a/gpgme/conversion.c b/gpgme/conversion.c
index f55e9a66..8faf8522 100644
--- a/gpgme/conversion.c
+++ b/gpgme/conversion.c
@@ -393,6 +393,16 @@ _gpgme_map_gnupg_error (char *err)
{
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++)
if (!strcmp (gnupg_errors[i].name, err))
return gpg_err_make (GPG_ERR_SOURCE_GPG, gnupg_errors[i].err);
diff --git a/gpgme/gpgme.h b/gpgme/gpgme.h
index c8e590a0..110fad0b 100644
--- a/gpgme/gpgme.h
+++ b/gpgme/gpgme.h
@@ -473,7 +473,7 @@ struct _gpgme_key_sig
{
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;
/* True if the signature is expired. */