aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgtar-list.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2010-08-25 10:31:47 +0000
committerWerner Koch <[email protected]>2010-08-25 10:31:47 +0000
commit789732e05a829136236e08398a2486d5c50d69ba (patch)
tree3604459063137465d90bb88f9cb351b28c4c2784 /tools/gpgtar-list.c
parentgpgconf does now work for Wince. (diff)
downloadgnupg-789732e05a829136236e08398a2486d5c50d69ba.tar.gz
gnupg-789732e05a829136236e08398a2486d5c50d69ba.zip
Changed option names.
Add O_BINARY for stdin and stdout.
Diffstat (limited to 'tools/gpgtar-list.c')
-rw-r--r--tools/gpgtar-list.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/gpgtar-list.c b/tools/gpgtar-list.c
index 1de15b58c..6f999d64f 100644
--- a/tools/gpgtar-list.c
+++ b/tools/gpgtar-list.c
@@ -275,7 +275,10 @@ gpgtar_list (const char *filename)
if (filename)
{
- stream = es_fopen (filename, "rb");
+ if (!strcmp (filename, "-"))
+ stream = es_stdout;
+ else
+ stream = es_fopen (filename, "rb");
if (!stream)
{
err = gpg_error_from_syserror ();
@@ -284,7 +287,10 @@ gpgtar_list (const char *filename)
}
}
else
- stream = es_stdin; /* FIXME: How can we enforce binary mode? */
+ stream = es_stdin;
+
+ if (stream == es_stdin)
+ es_set_binary (es_stdin);
for (;;)
{
@@ -303,7 +309,7 @@ gpgtar_list (const char *filename)
leave:
xfree (header);
- if (filename)
+ if (stream != es_stdin)
es_fclose (stream);
return;
}