From 041c6d7261a83799df58c072ea7880ea0cdf76c4 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 11 Aug 2010 10:20:53 +0000 Subject: Support "-" for --output. --- tools/gpgtar-create.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/gpgtar-create.c') diff --git a/tools/gpgtar-create.c b/tools/gpgtar-create.c index 7568c153a..3a18d7c69 100644 --- a/tools/gpgtar-create.c +++ b/tools/gpgtar-create.c @@ -843,7 +843,10 @@ gpgtar_create (char **inpattern) if (opt.outfile) { - outstream = es_fopen (opt.outfile, "wb"); + if (!strcmp (opt.outfile, "-")) + outstream = es_stdout; + else + outstream = es_fopen (opt.outfile, "wb"); if (!outstream) { err = gpg_error_from_syserror (); @@ -857,6 +860,9 @@ gpgtar_create (char **inpattern) outstream = es_stdout; } + if (outstream == es_stdout) + es_set_binary (es_stdout); + for (hdr = scanctrl->flist; hdr; hdr = hdr->next) { err = write_file (outstream, hdr); -- cgit v1.2.3