ITS#8280 Fix Windows EOL in test output

This commit is contained in:
Howard Chu 2015-10-21 00:46:01 +01:00
parent ad93b9e652
commit 634ccc758d

View file

@ -21,6 +21,9 @@
#include <ac/stdlib.h> #include <ac/stdlib.h>
#include <ac/string.h> #include <ac/string.h>
#include <ac/unistd.h> #include <ac/unistd.h>
#ifdef _WIN32
#include <fcntl.h>
#endif
#define DEFAULT_SPECS "ndb=a,null=n" #define DEFAULT_SPECS "ndb=a,null=n"
@ -233,6 +236,9 @@ main( int argc, char **argv )
backend = ""; backend = "";
} }
#ifdef _WIN32
_setmode(1, _O_BINARY); /* don't convert \n to \r\n on stdout */
#endif
flags = get_flags( backend, specs ); flags = get_flags( backend, specs );
filter_stdin( flags ? flags : get_flags( backend, DEFAULT_SPECS )); filter_stdin( flags ? flags : get_flags( backend, DEFAULT_SPECS ));
if ( fclose( stdout ) == EOF ) { if ( fclose( stdout ) == EOF ) {