]> granicus.if.org Git - graphviz/commitdiff
1. use just "w", not "wb" in file_select
authorellson <devnull@localhost>
Thu, 6 Sep 2007 18:04:23 +0000 (18:04 +0000)
committerellson <devnull@localhost>
Thu, 6 Sep 2007 18:04:23 +0000 (18:04 +0000)
2. add O_BIBARY to ming formatter

lib/common/emit.c
plugin/ming/gvrender_ming.c

index 02a4a6e9afdf3ba46275fc0a9b541ef4e0375b88..689b04a45c62c6f91543b87072db15d51e9bfd09 100644 (file)
@@ -2602,7 +2602,7 @@ char **parse_style(char *s)
 static FILE *file_select(char *str)
 {
     FILE *rv;
-    rv = fopen(str, "wb");
+    rv = fopen(str, "w");  /* binary formats add O_BINARY later */
     if (rv == NULL) {
         perror(str);
         exit(1);
index 8ce54867e1c888da9d592be80e0301872a1e5360..8cd9323cbebfbf83f2f580682085129153b1ea79 100644 (file)
@@ -48,6 +48,16 @@ static void ming_end_job(GVJ_t * job)
 {
     SWFMovie movie = (SWFMovie)(job->context);
 
+#ifdef HAVE_SETMODE
+#ifdef O_BINARY
+    /*
+     * Windows will do \n -> \r\n  translations on stdout
+     * unless told otherwise.
+     */
+    setmode(fileno(job->output_file), O_BINARY);
+#endif
+#endif
+
     SWFMovie_output_to_stream(movie, job->output_file);
     destroySWFMovie(movie);
     job->context = NULL;