2004-04-05 Werner Koch <wk@gnupg.org>
+ * verify.c (parse_error): Compare only the last part of the where
+ token.
+
* engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
option. Fixed pattern construction.
/* 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. */
+ underschore and the textual representation of the error code. */
if (*err >= '0' && *err <= '9')
return strtoul (err, NULL, 10);
gpgme_error_t err;
char *where = strchr (args, ' ');
char *which;
+ char *where_last;
if (where)
{
else
return gpg_error (GPG_ERR_INV_ENGINE);
+ /* It is often useful to compare only the last part of the where token. */
+ where_last = strrchr (where, '.');
+ if (!where_last)
+ where_last = where;
+
err = _gpgme_map_gnupg_error (which);
- if (!strcmp (where, "verify.findkey"))
+ if (!strcmp (where_last, ".findkey"))
sig->status = err;
- else if (!strcmp (where, "verify.keyusage")
+ else if (!strcmp (where_last, ".keyusage")
&& gpg_err_code (err) == GPG_ERR_WRONG_KEY_USAGE)
sig->wrong_key_usage = 1;