From bbe940c095f2bca7a1ca5f8e68ca1af98350a885 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 8 Sep 2016 00:45:45 +0200 Subject: gpg: Make --output work with --verify. * g10/mainproc.c (proc_plaintext): Handle opt.output. Signed-off-by: Werner Koch --- g10/mainproc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'g10/mainproc.c') diff --git a/g10/mainproc.c b/g10/mainproc.c index 7bb43502b..929e18a72 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -757,7 +757,12 @@ proc_plaintext( CTX c, PACKET *pkt ) if (!rc) { - rc = handle_plaintext (pt, &c->mfx, c->sigs_only, clearsig); + /* It we are in --verify mode, we do not want to output the + * signed text. However, if --output is also used we do what + * has been requested and write out the signed data. */ + rc = handle_plaintext (pt, &c->mfx, + (opt.outfp || opt.outfile)? 0 : c->sigs_only, + clearsig); if (gpg_err_code (rc) == GPG_ERR_EACCES && !c->sigs_only) { /* Can't write output but we hash it anyway to check the -- cgit v1.2.3