diff options
author | Werner Koch <wk@gnupg.org> | 2010-08-11 12:20:53 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-08-11 12:20:53 +0200 |
commit | 041c6d7261a83799df58c072ea7880ea0cdf76c4 (patch) | |
tree | 1d45a737981aa6f2a2c4de8c0645f9ce5f0d2d4b /tools/gpgtar-create.c | |
parent | Print a note about wldap32 (diff) | |
download | gnupg2-041c6d7261a83799df58c072ea7880ea0cdf76c4.tar.xz gnupg2-041c6d7261a83799df58c072ea7880ea0cdf76c4.zip |
Support "-" for --output.
Diffstat (limited to '')
-rw-r--r-- | tools/gpgtar-create.c | 8 |
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); |