# # # add_file "unix/make_io_binary.cc" # content [5eac53458ed69571e3e186508fc0d556329d773e] # # add_file "win32/make_io_binary.cc" # content [bc8215c517056756d637624ab59961bae5d63f0a] # # patch "ChangeLog" # from [4272e35d9bab06a033714e00ff9db33a20c87827] # to [f1ff148f4580def00fc214fac544a232303150e9] # # patch "Makefile.am" # from [dce99c70f3bf2037086208f6711420a60f5ab001] # to [d29d6ce43e67d3e7b8c1a221f4876d4675695d60] # # patch "commands.cc" # from [3726144b9fc8b5e9642b67bbb53700d22d4b5588] # to [30e5b40197d76957e932d0589d0fc9d9b8909fdb] # # patch "platform.hh" # from [3241dae2d6166846db8badebcb2296d34c10348c] # to [02cce907829ab54b8a3a6e4338913f33ddb826d7] # ============================================================ --- unix/make_io_binary.cc 5eac53458ed69571e3e186508fc0d556329d773e +++ unix/make_io_binary.cc 5eac53458ed69571e3e186508fc0d556329d773e @@ -0,0 +1,4 @@ +// I/O is always binary on sane platforms... +void make_io_binary() +{ +} ============================================================ --- win32/make_io_binary.cc bc8215c517056756d637624ab59961bae5d63f0a +++ win32/make_io_binary.cc bc8215c517056756d637624ab59961bae5d63f0a @@ -0,0 +1,11 @@ +#include +#include +#include + +#include "platform.h" + +void make_io_binary() +{ + _setmode(_fileno(stdin), _O_BINARY); + _setmode(_fileno(stdout), _O_BINARY); +} ============================================================ --- ChangeLog 4272e35d9bab06a033714e00ff9db33a20c87827 +++ ChangeLog f1ff148f4580def00fc214fac544a232303150e9 @@ -1,3 +1,12 @@ +2006-04-09 Timothy Brownawell + + * platform.hh (make_io_binary): new function, turn off textmode + "\n"->"\r\n" translation on Windows + * {win32,unix}/make_io_binary.cc: Implementations of said function. + * commands.cc (automate): Use said function so our output doesn't get + mangled. (Mostly important for "automate stdio".) + * Makefile.am: Add the new files. + 2006-04-08 Timothy Brownawell * commands.cc (process_netsync_args): fix crash when calling netsync ============================================================ --- Makefile.am dce99c70f3bf2037086208f6711420a60f5ab001 +++ Makefile.am d29d6ce43e67d3e7b8c1a221f4876d4675695d60 @@ -214,11 +214,11 @@ UNIX_PLATFORM_SOURCES = \ unix/read_password.cc unix/get_system_flavour.cc unix/process.cc unix/terminal.cc \ - unix/inodeprint.cc unix/fs.cc + unix/inodeprint.cc unix/fs.cc unix/make_io_binary.cc WIN32_PLATFORM_SOURCES = \ win32/read_password.cc win32/get_system_flavour.cc win32/process.cc win32/terminal.cc \ - win32/inodeprint.cc win32/fs.cc + win32/inodeprint.cc win32/fs.cc win32/make_io_binary.cc # primaries ============================================================ --- commands.cc 3726144b9fc8b5e9642b67bbb53700d22d4b5588 +++ commands.cc 30e5b40197d76957e932d0589d0fc9d9b8909fdb @@ -3927,6 +3927,8 @@ ++i; vector cmd_args(i, args.end()); + make_io_binary(); + automate_command(cmd, cmd_args, name, app, cout); } ============================================================ --- platform.hh 3241dae2d6166846db8badebcb2296d34c10348c +++ platform.hh 02cce907829ab54b8a3a6e4338913f33ddb826d7 @@ -28,6 +28,9 @@ int process_kill(pid_t pid, int signal); int process_sleep(unsigned int seconds); +// stop "\n"->"\r\n" from breaking automate on Windows +void make_io_binary(); + // for term selection bool have_smart_terminal(); // this function cannot call W/P/L, because it is called by the tick printing