From: Marcus Brinkmann Date: Thu, 29 Aug 2002 00:30:31 +0000 (+0000) Subject: 2002-08-29 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~842 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=92c15bf4e289e0ead67103b2bd76f65bd4a02813;p=gpgme.git 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 . --- diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index bef845b..e64a7fa 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/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/trunk/gpgme/passphrase.c b/trunk/gpgme/passphrase.c index 52d75ca..b3c89b8 100644 --- a/trunk/gpgme/passphrase.c +++ b/trunk/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/trunk/gpgme/vasprintf.c b/trunk/gpgme/vasprintf.c index 30b5e83..6b35e43 100644 --- a/trunk/gpgme/vasprintf.c +++ b/trunk/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') {