diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-06-28 08:45:20 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-06-28 08:45:20 +0000 |
commit | d4c5287a4f7f7239220865e84e18dd9e4dbd8c6f (patch) | |
tree | 8991a926c3b09267cc8e72ff9320c0fa72257b4c | |
parent | ea29734980e35bf08284e316e79cee37a1b53d8f (diff) |
do appending "b" to popen modes only on Windows differently from r26900 (compile time only).
git-svn-id: svn://tug.org/texlive/trunk@26907 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/web2c/lib/ChangeLog | 16 | ||||
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 18 |
2 files changed, 23 insertions, 11 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog index 1bec2130f51..1829f35ebcd 100644 --- a/Build/source/texk/web2c/lib/ChangeLog +++ b/Build/source/texk/web2c/lib/ChangeLog @@ -1,16 +1,16 @@ -2012-06-27 Norbert Preining <preining@logic.at> - - * texmfmp.c (runpopen): append "b" on Windows. - (open_in_or_pipe): do not use the "b" here. - (This makes pdftex's \input"|..." feature work again, - unintentionally broken.) - tex-live mail, 26 Jun 2012 14:02:26. - 2012-06-27 Karl Berry <karl@tug.org> * texmfmp.c (generic_synctex_get_current_name): return the empty string if passed null (can happen with -ini). +2012-06-26 Peter Breitenlohner <peb@mppmu.mpg.de> + + * texmfmp.c (open_{in,out}_or_pipe): Use popen() modes "rb" and + "wb" only for Windows, Posix allows them only for fopen(). + (This makes pdftex's \input"|..." feature work again, + unintentionally broken.) + tex-live mail, 26 Jun 2012 06:24:11. + 2012-05-04 Peter Breitenlohner <peb@mppmu.mpg.de> * printversion.c (printversionandexit): Update 'Copyright 2012'. diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 70cb3960792..2d6c2154097 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -527,9 +527,7 @@ runsystem (const char *cmd) /* Like runsystem(), the runpopen() function is called only when shellenabledp == 1. Unlike runsystem(), here we write errors to stderr, since we have nowhere better to use; and of course we return - a file handle (or NULL) instead of a status indicator. - - Also, we append "b" to MODE on Windows. */ + a file handle (or NULL) instead of a status indicator. */ static FILE * runpopen (char *cmd, const char *mode) @@ -1865,7 +1863,12 @@ open_in_or_pipe (FILE **f_ptr, int filefmt, const_string fopen_mode) fname = xmalloc(strlen((const_string)(nameoffile+1))+1); strcpy(fname,(const_string)(nameoffile+1)); recorder_record_input (fname + 1); +#ifdef WIN32 + /* Use binary mode on Windows. */ + *f_ptr = runpopen(fname+1,"rb"); +#else *f_ptr = runpopen(fname+1,"r"); +#endif free(fname); for (i=0; i<NUM_PIPES; i++) { if (pipes[i]==NULL) { @@ -1907,10 +1910,19 @@ open_out_or_pipe (FILE **f_ptr, const_string fopen_mode) is better to be prepared */ if (STREQ((fname+strlen(fname)-4),".tex")) *(fname+strlen(fname)-4) = 0; +#ifdef WIN32 + /* Use binary mode on Windows. */ + *f_ptr = runpopen(fname+1,"wb"); +#else *f_ptr = runpopen(fname+1,"w"); +#endif *(fname+strlen(fname)) = '.'; } else { +#ifdef WIN32 + *f_ptr = runpopen(fname+1,"wb"); +#else *f_ptr = runpopen(fname+1,"w"); +#endif } recorder_record_output (fname + 1); free(fname); |