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