summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-24 08:37:49 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-24 08:37:49 +0000
commit5877cb7870570d95e67c9c1462babc673cf61c8c (patch)
treeb2c68e813937e5bd896931906a74e9d6a34a12cf
parent2e58473f23e8dbae23ff1a121fa5af9e7d7e2d33 (diff)
kpathsea: Add win32_popen for MinGW to use always binary mode
git-svn-id: svn://tug.org/texlive/trunk@27134 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/kpathsea/ChangeLog5
-rw-r--r--Build/source/texk/kpathsea/mingw32.h14
2 files changed, 19 insertions, 0 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 4e7668d52cb..8ed88364759 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-23 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * mingw32.h (win32_popen): Static inline wrapper for _popen()
+ to use always binary mode.
+
2012-07-23 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* win32lib.c: rewrite kpathsea_win32_popen to use always binary
diff --git a/Build/source/texk/kpathsea/mingw32.h b/Build/source/texk/kpathsea/mingw32.h
index fbd3a0d15d1..c9853dd1d76 100644
--- a/Build/source/texk/kpathsea/mingw32.h
+++ b/Build/source/texk/kpathsea/mingw32.h
@@ -60,4 +60,18 @@ extern char *quote_args(char **);
extern KPSEDLL BOOL win32_get_long_filename (char *, char *, int);
extern KPSEDLL void texlive_gs_init(void);
+static inline FILE *
+win32_popen (const char *command, const char *fmode)
+{
+ char mode[3];
+
+ /* We always use binary mode */
+ mode[0] = fmode[0];
+ mode[1] = 'b';
+ mode[2] = '\0';
+
+ return _popen (command, mode);
+}
+#define popen(cmd, mode) win32_popen(cmd, mode)
+
#endif