summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipos/dvipos.c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-10 11:59:24 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-10 11:59:24 +0000
commita99c15329e7586e69373bf882c49813298ba1521 (patch)
treef3c340a4f14c194e5dc969e2840184e81035f8fe /Build/source/texk/dvipos/dvipos.c
parenta59a95241f8036bc92a4166f056e2f7cf1bcef9c (diff)
dvipos: Use binary mode for output files
Cast argument to avoid MSVC compiler warnings (from W32TeX) git-svn-id: svn://tug.org/texlive/trunk@26988 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipos/dvipos.c')
-rw-r--r--Build/source/texk/dvipos/dvipos.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Build/source/texk/dvipos/dvipos.c b/Build/source/texk/dvipos/dvipos.c
index da1fff0cd2a..f4613111289 100644
--- a/Build/source/texk/dvipos/dvipos.c
+++ b/Build/source/texk/dvipos/dvipos.c
@@ -21,7 +21,7 @@
#include "dvicore.h"
#include <limits.h>
-#if defined(MIKTEX) && defined(WIN32) && !defined(__MINGW32__)
+#ifdef MIKTEX
#include <getopt.h>
#endif
@@ -212,12 +212,16 @@ int main (int argc, char *argv[])
msg_out(M_FAIL, "Could not open the input file %s.", infname);
/* Open the output file */
- if (outfname == NULL) outfp = stdout;
- else if ((outfp = fopen(outfname, "at")) == NULL)
+ if (outfname == NULL) {
+ outfp = stdout;
+#ifdef WIN32
+ setmode(fileno(stdout), _O_BINARY);
+#endif
+ } else if ((outfp = fopen(outfname, "ab")) == NULL)
msg_out(M_FAIL, "Could not open the output file %s.\n", outfname);
/* Open the boundingbox file */
- if (bbxfname && (bbxfp = fopen(bbxfname, "wt")) == NULL)
+ if (bbxfname && (bbxfp = fopen(bbxfname, "wb")) == NULL)
msg_out(M_FAIL, "Could not open the boundingbox file %s.\n", bbxfname);
/* Open the framed DVI file */