From f01df1076053a92c241f6ae98375bbb7bfe3d8ee Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 29 Aug 2002 00:30:31 +0000 Subject: [PATCH] 2002-08-29 Marcus Brinkmann * passphrase.c (_gpgme_passphrase_status_handler): Reset CTX->result.passphrase->no_passphrase if passphrase is given (good or bad). Submitted by Jean DIRAISON . --- gpgme/ChangeLog | 6 ++++++ gpgme/passphrase.c | 2 ++ gpgme/vasprintf.c | 16 ++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index bef845b1..e64a7fa1 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,9 @@ +2002-08-29 Marcus Brinkmann + + * passphrase.c (_gpgme_passphrase_status_handler): Reset + CTX->result.passphrase->no_passphrase if passphrase is given (good + or bad). Submitted by Jean DIRAISON . + 2002-08-28 Marcus Brinkmann * posix-io.c (_gpgme_io_spawn): Use a double-fork approach. diff --git a/gpgme/passphrase.c b/gpgme/passphrase.c index 52d75ca6..b3c89b87 100644 --- a/gpgme/passphrase.c +++ b/gpgme/passphrase.c @@ -68,10 +68,12 @@ _gpgme_passphrase_status_handler (GpgmeCtx ctx, GpgmeStatusCode code, char *args case GPGME_STATUS_BAD_PASSPHRASE: ctx->result.passphrase->bad_passphrase++; + ctx->result.passphrase->no_passphrase = 0; break; case GPGME_STATUS_GOOD_PASSPHRASE: ctx->result.passphrase->bad_passphrase = 0; + ctx->result.passphrase->no_passphrase = 0; break; case GPGME_STATUS_NEED_PASSPHRASE: diff --git a/gpgme/vasprintf.c b/gpgme/vasprintf.c index 30b5e83f..6b35e43a 100644 --- a/gpgme/vasprintf.c +++ b/gpgme/vasprintf.c @@ -26,6 +26,19 @@ Boston, MA 02111-1307, USA. */ #include #include + +#ifndef va_copy +#if defined (__GNUC__) && defined (__PPC__) \ + && (defined (_CALL_SYSV) || defined (_WIN32)) +#define va_copy(d, s) (*(d) = *(s)) +#elif defined (MUST_COPY_VA_BYVAL) +#define va_copy(d, s) ((d) = (s)) +#else +#define va_copy(d, s) memcpy ((d), (s), sizeof (va_list)) +#endif +#endif + + #ifdef TEST int global_total_width; #endif @@ -44,8 +57,7 @@ int_vasprintf (result, format, args) int total_width = strlen (format) + 1; va_list ap; - /* FIXME: use va_copy() */ - memcpy (&ap, args, sizeof (va_list)); + va_copy (ap, *args); while (*p != '\0') {