summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-08-22 01:46:26 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2014-08-22 01:46:26 +0000
commit66bf92ea6f4043a250283f9f96df638a5b8e4c10 (patch)
tree50d2fbd4ea4c4bde1817f44045464812719da418 /Build
parent5d2b9323781e86126ca48a5d182002e28b387825 (diff)
Support multibyte filenames in pipe (Windows only)
git-svn-id: svn://tug.org/texlive/trunk@35004 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-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