summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog6
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c34
2 files changed, 39 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index fd5e6415ec6..5d214df244e 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,7 +1,11 @@
+2014-08-22 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
+
+ * texmfmp.c: Support multibyte filenames in pipe (Windows only)
+
2014-07-23 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
* texmfmp.c: Short-file-name convention is incompatible with
- --src-specials (w32 only).
+ --src-specials (Windows only).
2014-07-21 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 5bd5627cc61..0ff76b8a05c 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -490,6 +490,40 @@ shell_cmd_is_allowed (const char *cmd, char **safecmd, char **cmdname)
#ifdef WIN32
#undef system
#define system fsyscp_system
+static int is_include_space(const char *s)
+{
+ char *p;
+ p = strchr(s, ' ');
+ if(p) return 1;
+ p = strchr(s, '\t');
+ if(p) return 1;
+ return 0;
+}
+
+static FILE *wbinpopen(const char *cmd, const char *mode)
+{
+ assert(cmd && mode);
+ if (is_include_space (cmd)) {
+ FILE *ret;
+ const char *cmd2;
+ char *p, *q;
+ cmd2 = xmalloc (strlen (cmd) + 3);
+ q = (char *)cmd2;
+ p = (char *)cmd;
+ *q++= '\"';
+ while(*p)
+ *q++ = *p++;
+ *q++ = '\"';
+ *q = '\0';
+ ret = fsyscp_popen (cmd2, mode);
+ free ((char *)cmd2);
+ return ret;
+ } else {
+ return fsyscp_popen (cmd, mode);
+ }
+}
+#undef popen
+#define popen wbinpopen
#endif
int