2002-08-29 Marcus Brinkmann <marcus@g10code.de>

* passphrase.c (_gpgme_passphrase_status_handler): Reset
	CTX->result.passphrase->no_passphrase if passphrase is given (good
	or bad).  Submitted by Jean DIRAISON <jean.diraison@free.fr>.
This commit is contained in:
Marcus Brinkmann 2002-08-29 00:30:31 +00:00
parent 61aa194762
commit f01df10760
3 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2002-08-29 Marcus Brinkmann <marcus@g10code.de>
* passphrase.c (_gpgme_passphrase_status_handler): Reset
CTX->result.passphrase->no_passphrase if passphrase is given (good
or bad). Submitted by Jean DIRAISON <jean.diraison@free.fr>.
2002-08-28 Marcus Brinkmann <marcus@g10code.de> 2002-08-28 Marcus Brinkmann <marcus@g10code.de>
* posix-io.c (_gpgme_io_spawn): Use a double-fork approach. * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.

View File

@ -68,10 +68,12 @@ _gpgme_passphrase_status_handler (GpgmeCtx ctx, GpgmeStatusCode code, char *args
case GPGME_STATUS_BAD_PASSPHRASE: case GPGME_STATUS_BAD_PASSPHRASE:
ctx->result.passphrase->bad_passphrase++; ctx->result.passphrase->bad_passphrase++;
ctx->result.passphrase->no_passphrase = 0;
break; break;
case GPGME_STATUS_GOOD_PASSPHRASE: case GPGME_STATUS_GOOD_PASSPHRASE:
ctx->result.passphrase->bad_passphrase = 0; ctx->result.passphrase->bad_passphrase = 0;
ctx->result.passphrase->no_passphrase = 0;
break; break;
case GPGME_STATUS_NEED_PASSPHRASE: case GPGME_STATUS_NEED_PASSPHRASE:

View File

@ -26,6 +26,19 @@ Boston, MA 02111-1307, USA. */
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#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 #ifdef TEST
int global_total_width; int global_total_width;
#endif #endif
@ -44,8 +57,7 @@ int_vasprintf (result, format, args)
int total_width = strlen (format) + 1; int total_width = strlen (format) + 1;
va_list ap; va_list ap;
/* FIXME: use va_copy() */ va_copy (ap, *args);
memcpy (&ap, args, sizeof (va_list));
while (*p != '\0') while (*p != '\0')
{ {