summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-06-28 09:55:20 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-06-28 09:55:20 +0000
commitb1924bf9d717c6a6749aea733dafcc93b11f46f4 (patch)
treedf6b9c381251c7c0e6e613e7b4f1efb06f8f69f2 /Build/source
parentfaf1edeead15e04439abd81804529c66aaa394e8 (diff)
do appending "b" to popen modes only on Windows differently from r26900 (do it right)
git-svn-id: svn://tug.org/texlive/trunk@26909 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 2d6c2154097..d1c0fde336b 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -536,14 +536,9 @@ runpopen (char *cmd, const char *mode)
char *safecmd = NULL;
char *cmdname = NULL;
int allow;
-#ifdef WIN32
- char *pp;
-#endif
- string realmode = xmalloc(strlen(mode)+2);
- strcpy(realmode, mode);
#ifdef WIN32
- strcat(realmode, "b");
+ char *pp;
for (pp = cmd; *pp; pp++) {
if (*pp == '\'') *pp = '"';
@@ -557,9 +552,9 @@ runpopen (char *cmd, const char *mode)
allow = shell_cmd_is_allowed (cmd, &safecmd, &cmdname);
if (allow == 1)
- f = popen (cmd, realmode);
+ f = popen (cmd, mode);
else if (allow == 2)
- f = popen (safecmd, realmode);
+ f = popen (safecmd, mode);
else if (allow == -1)
fprintf (stderr, "\nrunpopen quotation error in command line: %s\n",
cmd);
@@ -570,7 +565,6 @@ runpopen (char *cmd, const char *mode)
free (safecmd);
if (cmdname)
free (cmdname);
- free (realmode);
return f;
}
#endif /* ENABLE_PIPES */