aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgtar-create.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tools/gpgtar-create.c8
1 files changed, 7 insertions, 1 deletions
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);