summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvidvi
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2017-06-23 14:55:46 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2017-06-23 14:55:46 +0000
commit38f8f5eed5786ef6d79867ad9c82f224d46c640a (patch)
tree7ada1b7e3720a9c991e0bc5a4eb340640622bffa /Build/source/texk/dvidvi
parent25a27b4b95bc9c08f15b37371d23956f6faf2dd7 (diff)
texk/dvidvi [Windows]: Allow Unicode file names
git-svn-id: svn://tug.org/texlive/trunk@44675 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvidvi')
-rw-r--r--Build/source/texk/dvidvi/ChangeLog5
-rw-r--r--Build/source/texk/dvidvi/Makefile.am4
-rw-r--r--Build/source/texk/dvidvi/Makefile.in1
-rwxr-xr-xBuild/source/texk/dvidvi/configure1
-rw-r--r--Build/source/texk/dvidvi/dvidvi.c28
5 files changed, 39 insertions, 0 deletions
diff --git a/Build/source/texk/dvidvi/ChangeLog b/Build/source/texk/dvidvi/ChangeLog
index 4df9e221d0a..47efb910eb5 100644
--- a/Build/source/texk/dvidvi/ChangeLog
+++ b/Build/source/texk/dvidvi/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-23 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * dvidvi.c, configure, Makefile.{am,in}:
+ Allow Unicode file names. (Windows only)
+
2017-06-18 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
* dvidvi.c: Add support for pTeX tate-kumi DVI.
diff --git a/Build/source/texk/dvidvi/Makefile.am b/Build/source/texk/dvidvi/Makefile.am
index 6f9225a4919..d4ee4834a55 100644
--- a/Build/source/texk/dvidvi/Makefile.am
+++ b/Build/source/texk/dvidvi/Makefile.am
@@ -6,6 +6,10 @@
AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -DKPATHSEA -DASCIIPTEX -DUNIX
AM_CFLAGS = $(WARNING_CFLAGS)
+if WIN32
+LDADD = $(KPATHSEA_LIBS)
+endif WIN32
+
bin_PROGRAMS = dvidvi
dvidvi_SOURCES = dvidvi.c
diff --git a/Build/source/texk/dvidvi/Makefile.in b/Build/source/texk/dvidvi/Makefile.in
index d12f2de79e7..7d39bbd80b1 100644
--- a/Build/source/texk/dvidvi/Makefile.in
+++ b/Build/source/texk/dvidvi/Makefile.in
@@ -542,6 +542,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -DKPATHSEA -DASCIIPTEX -DUNIX
AM_CFLAGS = $(WARNING_CFLAGS)
+@WIN32_TRUE@LDADD = $(KPATHSEA_LIBS)
dvidvi_SOURCES = dvidvi.c
dist_man1_MANS = dvidvi.1
EXTRA_DIST = a5bookle.bat a5bookle.com a5bookle.hlp a5test.tex \
diff --git a/Build/source/texk/dvidvi/configure b/Build/source/texk/dvidvi/configure
index 69760251358..964a2d110d5 100755
--- a/Build/source/texk/dvidvi/configure
+++ b/Build/source/texk/dvidvi/configure
@@ -636,6 +636,7 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+WIN32_TRUE
KPATHSEA_RULE
KPATHSEA_DEPEND
KPATHSEA_LIBS
diff --git a/Build/source/texk/dvidvi/dvidvi.c b/Build/source/texk/dvidvi/dvidvi.c
index 26f7433dd42..fb769fabc25 100644
--- a/Build/source/texk/dvidvi/dvidvi.c
+++ b/Build/source/texk/dvidvi/dvidvi.c
@@ -73,6 +73,14 @@ void error(const char *);
#endif
#include <kpathsea/c-pathch.h>
#define PATHSEP ENV_SEP
+#ifdef WIN32
+#include <kpathsea/config.h>
+#include <kpathsea/variable.h>
+#undef fopen
+#undef fprintf
+#define fopen fsyscp_fopen
+#define fprintf win32_fprintf
+#endif
#else /* not KPATHSEA */
#if defined(__TOS__)
#define READBIN "rb" /* TOS must use binary mode */
@@ -169,6 +177,16 @@ int prettycolumn ; /* the column we are at when running pretty */
int ptexdvi ; /* true if dvi file is extended (TATEKUMI) */
#endif
+#ifdef WIN32
+void win32_fprintf(FILE *fp, const char *fmt, ...) {
+ va_list argp;
+
+ va_start(argp, fmt);
+ win32_vfprintf(fp, fmt, argp);
+ va_end(argp);
+}
+#endif
+
/*
* This array holds values that indicate the length of a command, if
* we aren't concerned with that command (which is most of them) or
@@ -1241,6 +1259,16 @@ static void writedvifile(void) {
}
int main(int argc, char *argv[])
{
+#if defined(WIN32) && defined(KPATHSEA)
+ int ac;
+ char **av, *enc;
+ kpse_set_program_name(argv[0], "dvidvi");
+ enc = kpse_var_value("command_line_encoding");
+ if (get_command_line_args_utf8(enc, &ac, &av)) {
+ argc = ac;
+ argv = av;
+ }
+#endif
processargs(argc, argv) ;
readdvifile() ;
writedvifile() ;