pkgsrc/security/netpgp/patches/patch-src_lib_signature.c
khorben e3f36bb15d Output signatures to the standard output for "-"
This is to reflect the behaviour documented in netpgp(1).

Originally submitted on tech-pkg@ as:
[PATCH 09/11] Output signatures to the standard output for "-"

Only modified for consistency with the coding style; as also applied in
NetBSD's src repository.
2018-03-15 20:21:52 +00:00

19 lines
650 B
C

$NetBSD: patch-src_lib_signature.c,v 1.1 2018/03/15 20:21:52 khorben Exp $
Output signatures to the standard output for "-".
--- src/lib/signature.c.orig 2012-03-05 02:20:18.000000000 +0000
+++ src/lib/signature.c
@@ -903,7 +903,11 @@ open_output_file(pgp_output_t **output,
/* setup output file */
if (outname) {
- fd = pgp_setup_file_write(output, outname, overwrite);
+ if (strcmp(outname, "-") == 0) {
+ fd = pgp_setup_file_write(output, NULL, overwrite);
+ } else {
+ fd = pgp_setup_file_write(output, outname, overwrite);
+ }
} else {
unsigned flen = (unsigned)(strlen(inname) + 4 + 1);
char *f = NULL;