aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpg/t-sign.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/gpg/t-sign.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/gpg/t-sign.c b/tests/gpg/t-sign.c
index 28c34dca..0e5f5c36 100644
--- a/tests/gpg/t-sign.c
+++ b/tests/gpg/t-sign.c
@@ -87,13 +87,15 @@ main (int argc, char **argv )
GpgmeCtx ctx;
GpgmeError err;
GpgmeData in, out;
+ char *p;
do {
err = gpgme_new (&ctx);
fail_if_err (err);
- if ( !getenv("GPG_AGENT_INFO") ) {
- gpgme_set_passphrase_cb ( ctx, passphrase_cb, NULL );
- }
+
+ p = getenv("GPG_AGENT_INFO");
+ if (!(p && strchr (p, ':')))
+ gpgme_set_passphrase_cb ( ctx, passphrase_cb, NULL );
gpgme_set_textmode (ctx, 1);
gpgme_set_armor (ctx, 1);