mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-24 21:33:51 +03:00
xmllint: Set stdin/stdout to binary on Windows
This commit is contained in:
parent
4b6e68282b
commit
5589c9ea6f
10
xmlcatalog.c
10
xmlcatalog.c
@ -13,6 +13,11 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
#include <readline/readline.h>
|
||||
#ifdef HAVE_LIBHISTORY
|
||||
@ -315,6 +320,11 @@ int main(int argc, char **argv) {
|
||||
int ret;
|
||||
int exit_value = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
_setmode(_fileno(stdin), _O_BINARY);
|
||||
_setmode(_fileno(stdout), _O_BINARY);
|
||||
_setmode(_fileno(stderr), _O_BINARY);
|
||||
#endif
|
||||
|
||||
if (argc <= 1) {
|
||||
usage(argv[0]);
|
||||
|
@ -2990,6 +2990,12 @@ xmllintMain(int argc, const char **argv, xmlResourceLoader loader) {
|
||||
maxAmpl = 0;
|
||||
#endif /* XMLLINT_FUZZ */
|
||||
|
||||
#ifdef _WIN32
|
||||
_setmode(_fileno(stdin), _O_BINARY);
|
||||
_setmode(_fileno(stdout), _O_BINARY);
|
||||
_setmode(_fileno(stderr), _O_BINARY);
|
||||
#endif
|
||||
|
||||
if (argc <= 1) {
|
||||
usage(ERR_STREAM, argv[0]);
|
||||
return(XMLLINT_ERR_UNCLASS);
|
||||
|
Loading…
Reference in New Issue
Block a user