view src/mingw-ghostscript-1-win.patch @ 3792:1a2fec9962a7

ghostscript: update to 9.15 * src/ghostscript-mingw-i686-makefile: update to prebuilt file for this version * src/ghostscript.mk: update version, checksum * src/mingw-ghostscript-1-win.patch: new file * dist-files.mk: add src/mingw-ghostscript-1-win.patch
author John Donoghue
date Thu, 05 Feb 2015 16:04:09 -0500
parents
children 50f11d938045
line wrap: on
line source

diff -ur ghostscript-9.15.orig/base/gp_unifs.c ghostscript-9.15/base/gp_unifs.c
--- ghostscript-9.15.orig/base/gp_unifs.c	2015-02-15 10:31:35.198127593 -0500
+++ ghostscript-9.15/base/gp_unifs.c	2015-02-15 13:11:28.950483663 -0500
@@ -80,6 +80,14 @@
     int prefix_length = strlen(prefix);
     int len = gp_file_name_sizeof - prefix_length - 8;
     FILE *fp;
+#ifdef __MINGW32__
+    // add 'b' to ensure in binary mode
+    char tmpmode[32];
+ 
+    strcpy(tmpmode, mode);
+    strcat(tmpmode,"b");
+    mode = tmpmode;
+#endif
 
     if (gp_file_name_is_absolute(prefix, prefix_length))
         *fname = 0;
@@ -148,6 +156,15 @@
 FILE *
 gp_fopen(const char *fname, const char *mode)
 {
+#ifdef __MINGW32__
+    // add 'b' to ensure in binary mode
+    char tmpmode[32];
+ 
+    strcpy(tmpmode, mode);
+    strcat(tmpmode,"b");
+    mode = tmpmode;
+#endif
+
     return fopen(fname, mode);
 }