1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Support "-" for --output.

This commit is contained in:
Werner Koch 2010-08-11 10:20:53 +00:00
parent fa3120a1bc
commit 041c6d7261
2 changed files with 12 additions and 1 deletions

View file

@ -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);