aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 4ab20278d..1510ed70b 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -24,6 +24,10 @@
#include <string.h>
#include <errno.h>
#include <assert.h>
+#ifdef HAVE_DOSISH_SYSTEM
+ #include <fcntl.h> /* for setmode() */
+#endif
+
#include "util.h"
#include "memory.h"
#include "options.h"
@@ -81,6 +85,9 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
else if( !*fname || (*fname=='-' && !fname[1])) {
/* no filename or "-" given; write to stdout */
fp = stdout;
+ #ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(fp) , O_BINARY );
+ #endif
}
else if( !overwrite_filep( fname ) ) {
rc = G10ERR_CREATE_FILE;