summaryrefslogtreecommitdiff
path: root/Build/source/texk/seetexk/dvibook.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/seetexk/dvibook.c')
-rw-r--r--Build/source/texk/seetexk/dvibook.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/Build/source/texk/seetexk/dvibook.c b/Build/source/texk/seetexk/dvibook.c
index 3c590e0478f..b57f50cfce1 100644
--- a/Build/source/texk/seetexk/dvibook.c
+++ b/Build/source/texk/seetexk/dvibook.c
@@ -35,6 +35,9 @@
#include <kpathsea/config.h>
#include <kpathsea/c-fopen.h>
#include <kpathsea/getopt.h>
+#if defined(WIN32)
+#include <kpathsea/variable.h>
+#endif
#else
#define FOPEN_RBIN_MODE "rb"
#define FOPEN_WBIN_MODE "wb"
@@ -54,6 +57,11 @@ extern int optind;
#include <ctype.h>
#include "seek.h"
+#if defined(WIN32) && defined(KPATHSEA)
+#undef fopen
+#define fopen fsyscp_fopen
+#endif
+
#define white(x) ((x) == ' ' || (x) == '\t' || (x) == ',')
#define MAXDVIPAGES 1000 /* max (absolute) pages in DVI file */
@@ -397,6 +405,17 @@ main(int argc, char **argv)
register int c;
register char *s;
char *outname = NULL;
+#if defined(WIN32) && defined(KPATHSEA)
+ int ac;
+ char **av, *enc;
+
+ kpse_set_program_name(argv[0], "dvibook");
+ enc = kpse_var_value("command_line_encoding");
+ if (get_command_line_args_utf8(enc, &ac, &av)) {
+ argc = ac;
+ argv = av;
+ }
+#endif
Signature = 0;