[svn] GnuPG - r5388 - trunk/tools

svn author wk cvs at cvs.gnupg.org
Wed Aug 11 12:20:54 CEST 2010


Author: wk
Date: 2010-08-11 12:20:53 +0200 (Wed, 11 Aug 2010)
New Revision: 5388

Modified:
   trunk/tools/ChangeLog
   trunk/tools/gpgtar-create.c
Log:
Support "-" for --output.


Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog	2010-08-10 14:27:45 UTC (rev 5387)
+++ trunk/tools/ChangeLog	2010-08-11 10:20:53 UTC (rev 5388)
@@ -1,3 +1,8 @@
+2010-08-11  Werner Koch  <wk at g10code.com>
+
+	* gpgtar-create.c (gpgtar_create): Allow "-" for stdout in
+	opt.outfile.  Switch es_stdout to binary mode.
+
 2010-08-09  Werner Koch  <wk at g10code.com>
 
 	* watchgnupg.c: Inlcude in.h and inet.h.

Modified: trunk/tools/gpgtar-create.c
===================================================================
--- trunk/tools/gpgtar-create.c	2010-08-10 14:27:45 UTC (rev 5387)
+++ trunk/tools/gpgtar-create.c	2010-08-11 10:20:53 UTC (rev 5388)
@@ -843,7 +843,10 @@
 
   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 @@
       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);





More information about the Gnupg-commits mailing list