summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvi2tty
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2016-04-03 05:19:44 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2016-04-03 05:19:44 +0000
commitd50f7c31b156ee8553059a40e22f92dcb4db4e01 (patch)
tree16a6a0a704613bd5ba238129bc575d39325bd6d2 /Build/source/texk/dvi2tty
parentd97e6418c275bf1ca32c4e5407c9d9d586616f24 (diff)
texk/dvi2tty: Delete dvi2tty-PATCHES/*
git-svn-id: svn://tug.org/texlive/trunk@40222 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvi2tty')
-rw-r--r--Build/source/texk/dvi2tty/ChangeLog6
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/ChangeLog102
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/TL-Changes6
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-01-typecast12
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-02-initialize12
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-03-uptex646
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-04-OpenSolaris27
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-05-win3212
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-06-malloc70
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-07-win3257
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-08-config_h68
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-09-win3291
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-10-ChangeLog19
13 files changed, 6 insertions, 1122 deletions
diff --git a/Build/source/texk/dvi2tty/ChangeLog b/Build/source/texk/dvi2tty/ChangeLog
index c089570b222..54012367a0e 100644
--- a/Build/source/texk/dvi2tty/ChangeLog
+++ b/Build/source/texk/dvi2tty/ChangeLog
@@ -1,3 +1,9 @@
+2016-04-03 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * Delete the directory dvi2tty-PATCHES/ because upstream
+ has been changed and the TeX Live svn repository is now
+ synchronizing with the upstream.
+
2016-03-05 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
dvi2tty-6.0.0.
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/ChangeLog b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/ChangeLog
deleted file mode 100644
index 5274c207cd4..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/ChangeLog
+++ /dev/null
@@ -1,102 +0,0 @@
-2015-04-17 Karl Berry <karl@tug.org>
-
- * patch-10-ChangeLog (new): Remove obsolete part of ChangeLog.
-
-2014-02-01 TANAKA Takuji <KXD02663@nifty.ne.jp>
-
- * patch-09-win32 (new): Allow Unicode filename (Windows only).
-
-2013-06-28 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * patch-08-config_h (new): First include <kpathsea/config.h>.
-
-2012-09-06 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * patch-07-win32 [WIN32]: Use "sjis" file encoding (from W32TeX).
-
-2012-07-10 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * patch-07-win32 (new): Cast arguments to avoid MSVC compiler
- warnings (from W32TeX).
-
-2012-06-22 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * patch-05-win32 (new): WIN32 MSVC lacks <unistd.h> and requires
- <malloc.h>.
-
- * patch-06-malloc (new): Avoid buffer overrun for long pathnames
- (detected by Ken Brown <kbrow1i@gmail.com>),
- and check all values returned by malloc().
-
-2012-04-26 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * patch-04-OpenSolaris: New patch:
- * dvistuff.c (postamble): Work around a bug in large file
- support (LFS) for 32-bit OpenSolaris/OpenIndiana.
-
-2011-11-21 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * patch-03-uptex: New patch for upTeX support
- from Tanaka Takuji <KXD02663@nifty.ne.jp>.
-
-2011-01-27 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * patch-02-initialize: New patch:
- * dvistuff.c (fontdef): Initialize the fontnum member.
-
-2011-01-26 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * patch-01-typecast: New patch:
- * dvistuff.c (dopage): Typecast dochar() argument to the
- parameter type 'unsigned char', not to 'char'.
-
-2010-11-13 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- Import dvi2tty-5.3.4.
- * patch-*-* (removed): Now all in distribution.
-
-2010-11-09 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * patch-01-texk (removed): Avoid unnecessary modifications.
- * patch-07-typo: Adapted.
-
- * patch-61-bug-fix (new): Correctly handle input filenames
- without ".dvi".
-
- * patch-62-kpathsea (new): Use kpse_readable_file() function
- from kpathsea library, replacing duplicated ancient code.
-
-2010-11-06 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- Import dvi2tty-5.3.3.
-
- * patch-{02,03,05,06,50,70}-* (removed): Now in distribution.
- * patch-01-texk, patch-04-pager: Adapted.
- * patch-60-warnings: Adapted (some parts now in distribution).
- * patch-81-maybe-scand (removed): Obsoleted by dvi2tty-5.3.3.
- * patch-{80,90,91}-* (removed): Obsolete.
-
- * patch-07-typo (new): Fix a typo.
-
-2010-10-23 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- Import dvi2tty-5.3.1.
-
- Changes from pre2006 teTeX repository:
- * patch-01-texk (new): TeX Live version.
- * patch-02-simple-typos (new).
- * patch-04-pager (new).
- * patch-06-bug-fix (new).
- * patch-80-maybe-bug-fix (new): To be decided.
- * patch-81-maybe-scand (new): To be decided.
-
- Changes from TeX Live repository (2009 and 2010):
- * patch-03-ANSI-C (new): Function prototypes and declarations.
- * patch-05-getline (new): Avoid name conflict.
- * patch-50-kpathsea (new): Use kpathsea.
- * patch-60-warnings (new): Avoid warnings.
- * patch-70-disdvi-xetex (new): Decode pTeX and XeTeX opcodes.
-
- * patch-90-undo-some (new): Revert to to the ...
- * patch-91-undo-rest (new): ... version from 2010-10-15.
-
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/TL-Changes b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/TL-Changes
deleted file mode 100644
index d903f98fcf8..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/TL-Changes
+++ /dev/null
@@ -1,6 +0,0 @@
-Changes applied to the dvi2tty-5.3.4 tree as obtained from:
- http://www.mesa.nl/pub/dvi2tty/dvi2tty-5.3.4.tgz.
-
-Removed:
- nagios.init
-
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-01-typecast b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-01-typecast
deleted file mode 100644
index eaa46090ded..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-01-typecast
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur dvi2tty-5.3.4.orig/dvistuff.c dvi2tty-5.3.4/dvistuff.c
---- dvi2tty-5.3.4.orig/dvistuff.c 2010-11-13 16:35:19.000000000 +0100
-+++ dvi2tty-5.3.4/dvistuff.c 2011-01-26 11:35:56.526064435 +0100
-@@ -441,7 +441,7 @@
-
- while ((opcode = (int) get1()) != EOP) { /* process page until eop */
- if (opcode <= LASTCHAR)
-- dochar((char) opcode);
-+ dochar((unsigned char) opcode);
- else if ((opcode >= FONT_00) && (opcode <= FONT_63))
- setfont((long) opcode - FONT_00);
- else if (opcode > POST_POST)
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-02-initialize b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-02-initialize
deleted file mode 100644
index 35c3abb2237..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-02-initialize
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur dvi2tty-5.3.4.orig/dvistuff.c dvi2tty-5.3.4/dvistuff.c
---- dvi2tty-5.3.4.orig/dvistuff.c 2011-01-26 11:35:56.000000000 +0100
-+++ dvi2tty-5.3.4/dvistuff.c 2011-01-27 13:20:02.928406313 +0100
-@@ -1419,6 +1419,8 @@
- }
- if (japan)
- fonts->fontnum = getjsubfont(name);
-+ else
-+ fonts->fontnum = 0;
-
- if ((strstr(name, "sy")) != NULL)
- fonts->flags |= SYMFONT;
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-03-uptex b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-03-uptex
deleted file mode 100644
index 7e50b25af42..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-03-uptex
+++ /dev/null
@@ -1,646 +0,0 @@
-diff -ur dvi2tty-5.3.4.orig/Changelog dvi2tty-5.3.4/Changelog
---- dvi2tty-5.3.4.orig/Changelog 2010-11-13 16:36:04.000000000 +0100
-+++ dvi2tty-5.3.4/Changelog 2011-11-21 19:56:42.000000000 +0100
-@@ -1,4 +1,9 @@
- /******************************************************************************
-+ * Takuji Tanaka: 20111119 (KXD02663@nifty.ne.jp)
-+ * Used ptexenc library for Japanese TeX.
-+ * Enabled UTF8 output for Japanese TeX with option -Eu.
-+ * Added upTeX DVI support with option -U.
-+ * Added auto detected Japanese fonts in japanese-otf package.
- * Marcel Mol: 20101113 (marcel@mesa.nl)
- * Version 5.3.4
- * Fix VERSION code
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.1 dvi2tty-5.3.4/dvi2tty.1
---- dvi2tty-5.3.4.orig/dvi2tty.1 2010-11-13 16:30:56.000000000 +0100
-+++ dvi2tty-5.3.4/dvi2tty.1 2011-11-21 21:26:24.000000000 +0100
-@@ -129,7 +129,7 @@
- Note this may interfere with -u. Best not to use -u and -s together.
- .TP
- .B \-J
--Auto detect NTT JTeX and ASCII pTeX dvi format.
-+Auto detect NTT JTeX, ASCII pTeX, and upTeX dvi format.
- .TP
- .B \-N
- Display NTT JTeX dvi.
-@@ -137,6 +137,13 @@
- .B \-A
- Display ASCII pTeX dvi.
- .TP
-+.B \-U
-+Display upTeX dvi.
-+.TP
-+.B \-Eenc
-+Set output Japanese encoding. The enc argument 'e', 's', 'j', and 'u'
-+denotes EUC-JP, Shift_JIS, ISO-2022-JP, and UTF-8, respectively.
-+.TP
- .B \-bdelim
- Print the name of fonts when switching to it (and ending it). The delim
- argument is used to delimit the fontname.
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.c dvi2tty-5.3.4/dvi2tty.c
---- dvi2tty-5.3.4.orig/dvi2tty.c 2010-11-13 16:33:50.000000000 +0100
-+++ dvi2tty-5.3.4/dvi2tty.c 2011-11-21 22:30:24.000000000 +0100
-@@ -55,11 +55,11 @@
-
- #define MAXLEN 100 /* size of char-arrays for strings */
- #if defined(MSDOS) || defined(VMS) || defined(AMIGA)
--#define OPTSET "haJwepPousltvbcAN" /* legal options */
--#define OPTWARG "wepPovb" /* options with argument */
-+#define OPTSET "haJweEpPousltvbcANU" /* legal options */
-+#define OPTWARG "weEpPovb" /* options with argument */
- #else
--#define OPTSET "haJwepPousqlfFtvbcAN"/* legal options */
--#define OPTWARG "wepPoFvb" /* options with argument */
-+#define OPTSET "haJweEpPousqlfFtvbcANU" /* legal options */
-+#define OPTWARG "weEpPoFvb" /* options with argument */
- #endif
-
- /*
-@@ -75,10 +75,9 @@
- #define bdopt 7 /* bad option */
- #define onepp 8 /* only one page list allowed */
- #define noarg 9 /* argument expected */
--#define confl 10 /* -N and -A conflict */
--#define confj 11 /* -J conflicts -N or -A */
-+#define confl 10 /* -J, -N, -A, and -U conflict */
- #if defined(THINK_C)
--#define nored 12 /* if no input file, redirect stdin */
-+#define nored 11 /* if no input file, redirect stdin */
- #endif
-
-
-@@ -166,6 +165,7 @@
- Argc = argc;
- Argv = argv;
-
-+ set_enc_string (NULL, "default");
- getargs(); /* read command line arguments */
- #if defined(THINK_C)
- if (inputfromfile) {
-@@ -380,10 +380,35 @@
- j = strlen(optarg);
- break;
- #endif
-- /* case 'J' : japan = TRUE; break; */
- case 'J' : jautodetect = TRUE; break;
-- case 'A' : asciip = TRUE; break; /* ASCII pTeX */
-- case 'N' : japan = TRUE; break; /* NTT jTeX */
-+ case 'U' : uptex = TRUE; japan = TRUE; /* upTeX */
-+ jautodetect = FALSE;
-+ enable_UPTEX(true);
-+ set_enc_string (NULL, UPTEX_INTERNAL_ENC);
-+ break;
-+ case 'A' : asciip = TRUE; japan = TRUE; /* ASCII pTeX */
-+ jautodetect = FALSE;
-+ set_enc_string (NULL, PTEX_INTERNAL_ENC);
-+ break;
-+ case 'N' : nttj = TRUE; japan = TRUE; /* NTT jTeX */
-+ jautodetect = FALSE;
-+ set_enc_string (NULL, JTEX_INTERNAL_ENC);
-+ break;
-+ case 'E' :
-+ switch (optarg[0]) {
-+ case 'e' :
-+ set_enc_string ("euc", NULL); break;
-+ case 's' :
-+ set_enc_string ("sjis", NULL); break;
-+ case 'j' :
-+ set_enc_string ("jis", NULL); break;
-+ case 'u' :
-+ set_enc_string ("utf8", NULL); break;
-+ default :
-+ usage(noarg);
-+ }
-+ j++;
-+ break;
- case 't' : ttfont = TRUE; break;
- case 'l' : noffd = TRUE; break;
- case 's' : scascii ^= 1; break;
-@@ -436,14 +461,12 @@
- }
-
- /* Option conflict */
-- if (japan && asciip) {
-+ if ((asciip && uptex) ||
-+ (nttj && (asciip || uptex)) ||
-+ (jautodetect && (nttj || asciip || uptex))) {
- usage(confl);
- }
-
-- if (jautodetect && (japan || asciip)) {
-- usage(confj);
-- }
--
- return;
-
- } /* setoption */
-@@ -707,7 +730,10 @@
- void usage(int uerr)
- {
-
-- fprintf(stderr, "%s", Copyright);
-+ if (jautodetect || nttj || asciip || uptex)
-+ fprintf(stderr, "%s (%s) %s", Progname, get_enc_string(), Copyright);
-+ else
-+ fprintf(stderr, "%s %s", Progname, Copyright);
-
- if (uerr != ign) {
- fprintf(stderr,"\n%s: ", progname);
-@@ -734,9 +760,7 @@
- break;
- case onepp : fprintf(stderr, "only one pagelist allowed");
- break;
-- case confl : fprintf(stderr, "-N and -A are conflicting");
-- break;
-- case confj : fprintf(stderr, "-J conflicts -N or -A");
-+ case confl : fprintf(stderr, "-J, -N, -A, and -U are mutually exclusive");
- break;
- #if defined(THINK_C)
- case nored : fprintf(stderr, "\nIf no input file is given in\
-@@ -794,12 +818,16 @@
- fprintf(stderr,
- " -u Toggle latin1 support (default %s).\n", DEFLATIN1 ? "on" : "off");
- fprintf(stderr,
-- " -J Enable auto detect for NTT JTeX and ASCII pTeX (japanese fonts).\n");
-+ " -J Enable auto detect for NTT JTeX, ASCII pTeX, and upTeX (japanese fonts).\n");
- fprintf(stderr,
- " -N Support NTT JTeX dvi.\n");
- fprintf(stderr,
- " -A Support ASCII pTeX dvi.\n");
- fprintf(stderr,
-+ " -U Support upTeX dvi.\n");
-+ fprintf(stderr,
-+ " -Eenc Output Japanese encoding. e:EUC s:SJIS j:JIS, u:UTF8.\n");
-+ fprintf(stderr,
- " -c Override -a -u -s and print all characters 0-255.\n");
- fprintf(stderr,
- " -bdelim Print font switch as text: delimcmr10miled\n");
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.h dvi2tty-5.3.4/dvi2tty.h
---- dvi2tty-5.3.4.orig/dvi2tty.h 2010-11-13 16:33:42.000000000 +0100
-+++ dvi2tty-5.3.4/dvi2tty.h 2011-11-21 22:28:42.000000000 +0100
-@@ -20,7 +20,8 @@
-
- #define VERSION "5.3.4"
-
--#define Copyright "dvi2tty Copyright (C) 1984, 1985, 1986 Svante Lindahl.\n\
-+#define Progname "dvi2tty"
-+#define Copyright "Copyright (C) 1984, 1985, 1986 Svante Lindahl.\n\
- Copyright (C) 1989-2010 M.J.E. Mol, MESA Consulting B.V."
-
-
-@@ -54,6 +55,18 @@
- */
- #define MAXTERMWIDTH 332
-
-+#include <ptexenc/ptexenc.h>
-+#include <ptexenc/unicode.h>
-+
-+/* internal encoding for NTT JTeX : "euc" */
-+#define JTEX_INTERNAL_ENC "euc"
-+
-+/* internal encoding for ASCII pTeX : "euc" or "sjis" */
-+#define PTEX_INTERNAL_ENC "euc"
-+
-+/* internal encoding for upTeX : "uptex" */
-+#define UPTEX_INTERNAL_ENC "uptex"
-+
- /*
- * ERROR CODES , don't start with 0
- */
-@@ -109,9 +122,11 @@
- extern bool latin1; /* latin1 chars (dvistuff.c) */
- extern bool accent; /* Output accent stuff(dvistuff.c) */
- extern bool ttfont; /* tt font assumed (dvistuff.c) */
--extern bool japan; /* NTT jTeX font support (dvistuff.c) */
-+extern bool jautodetect; /* Autodetect NTT jTeX, ASCII pTeX and upTeX (dvistuff.c) */
-+extern bool nttj; /* NTT jTeX font support (dvistuff.c) */
- extern bool asciip; /* ASCII pTeX font support (dvistuff.c) */
--extern bool jautodetect; /* Autodetect NTT jTex and ASCII pTeX (dvistuff.c) */
-+extern bool uptex; /* upTeX font support (dvistuff.c) */
-+extern bool japan; /* japanized TeX font support (dvistuff.c) */
- extern bool noffd; /* output ^L or formfeed (dvistuff.c) */
- extern bool printfont; /* include font switches (dvistuff.c) */
- extern bool allchar; /* output all characters (dvistuff.c */
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.tex dvi2tty-5.3.4/dvi2tty.tex
---- dvi2tty-5.3.4.orig/dvi2tty.tex 2010-10-30 12:13:29.000000000 +0200
-+++ dvi2tty-5.3.4/dvi2tty.tex 2011-11-21 21:26:57.000000000 +0100
-@@ -192,11 +192,16 @@
- terminals in Scandinavia are mapped to ``\{$|$\}[\bs ]''.
- Note this may interfere with -u. Best not to use -u and -s together.
- \item[{{\bf -J}}]
--Auto detect NTT JTeX and ASCII pTeX dvi format.
-+Auto detect NTT JTeX, ASCII pTeX, and upTeX dvi format.
- \item[{{\bf -N}}]
- Display NTT JTeX dvi.
- \item[{{\bf -A}}]
- Display ASCII pTeX dvi.
-+\item[{{\bf -U}}]
-+Display upTeX dvi.
-+\item[{{\bf -Eenc}}]
-+Set output Japanese encoding. The enc argument 'e', 's', 'j', and 'u'
-+denotes EUC-JP, Shift\_JIS, ISO-2022-JP, and UTF-8, respectively.
- \end{list}
- %
- % NOTE --- No other files are used under VMS.
-diff -ur dvi2tty-5.3.4.orig/dvistuff.c dvi2tty-5.3.4/dvistuff.c
---- dvi2tty-5.3.4.orig/dvistuff.c 2011-01-27 13:20:02.000000000 +0100
-+++ dvi2tty-5.3.4/dvistuff.c 2011-11-21 22:41:54.000000000 +0100
-@@ -87,13 +87,6 @@
- #define sget3() snum(3)
- #define sget4() snum(4)
-
--#if !defined(JIS)
--# define JIS 1 /* if 0 then EUC or SJIS */
--#endif
--#if !defined(SJIS)
--# define SJIS 0 /* if !JIS, 0 then EUC */
--#endif
--
-
- /*
- * Structure and variable definitions
-@@ -122,7 +115,7 @@
- long num;
- struct _font * next;
- char * name;
-- char flags; /* to store font types, to get rid of japan/asciip/ttfont/symbolfon/mifont vars */
-+ char flags; /* to store font types, to get rid of nttj/asciip/uptex/ttfont/symbolfon/mifont vars */
- int fontnum; /* helper for japanese fonts */
- } font;
-
-@@ -140,8 +133,10 @@
- bool accent; /* if true output accents etc: \'{e} etc. */
- bool ttfont = FALSE; /* if true we assumed ttfonts, not cmr */
- bool symbolfont = FALSE; /* true if font is a symbol font */
--bool japan = FALSE; /* switch to NTT japanese fonts ... */
-+bool nttj = FALSE; /* switch to NTT japanese fonts ... */
- bool asciip = FALSE; /* switch to ASCII japanese fonts ... */
-+bool uptex = FALSE; /* switch to upTeX CJK fonts ... */
-+bool japan = FALSE; /* switch to NTT/ASCII/.. japanese fonts ... */
- bool jautodetect = FALSE; /* switch if do auto detection of Japanese TeX */
- bool jdetect = FALSE; /* switch if Japanese TeX detection is done */
- bool mifont = FALSE; /* ASCII japanese font ??? */
-@@ -177,14 +172,7 @@
- font * fonts = NULL; /* List of fontnames defined */
- font * fnt = NULL; /* Current font */
-
--#if JIS
--# define SJIS 0
--int inkanji = 0; /* is in kanji sequence */
--# define KANJIIN "\033$B" /* was $@ in debian 5.1-13 patch.. */
--# define KANJIOUT "\033(J"
--#endif
--int kanji1 = 0; /* is first kanji character */
--int kanji2 = 0; /* is second kanji character */
-+int kanji1 = 0; /* number of rest of trailer bytes in kanji character */
-
-
-
-@@ -219,7 +207,7 @@
- void setfont (long);
- void jischar (unsigned long);
- int compute_jis (int, unsigned int, unsigned int *, unsigned int *);
--void dokanji (unsigned long);
-+void dokanji (long);
- int getjsubfont (char *);
-
- #else
-@@ -249,7 +237,7 @@
- void setfont (long fntnum);
- void jischar (unsigned long ch);
- void compute_jis (int f, unsigned int c, unsigned int * ku, unsigned int * ten);
--void dokanji (unsigned long ch);
-+void dokanji (long ch);
- int getjsubfont (char * s);
- #if defined(VMS)
- long vmsseek ();
-@@ -448,9 +436,9 @@
- errorexit(illop);
- else
- switch (opcode) {
-- case SET1 : japan ? jischar(get1()) : setchar(get1());break;
-- case SET2 : asciip ? dokanji(get2()) : setchar(get2()); break;
-- case SET3 : setchar(get3()); break;
-+ case SET1 : nttj ? jischar(get1()) : setchar(get1());break;
-+ case SET2 : (asciip || uptex) ? dokanji(get2()) : setchar(get2()); break;
-+ case SET3 : uptex ? dokanji(get3()) : setchar(get3()); break;
- case SET4 : setchar(get4()); break;
- case SET_RULE : { long height = sget4();
- rule(MOVE, sget4(), height); break;
-@@ -617,8 +605,9 @@
-
- void printpage(void)
- {
-- register int i, j;
-+ register int i, j, k;
- register unsigned char ch;
-+ unsigned char buff[4];
-
- if (sptr != 0)
- fprintf(stderr, "dvi2tty: warning - stack not empty at eop.\n");
-@@ -637,75 +626,59 @@
- i++, j++) {
- ch = currentline->text[i - leftmargin];
-
-- if (asciip) {
-- if (kanji1) {
--#if !JIS && !SJIS
-- ch |= 0x80;
--#endif
-- kanji2 = 1;
-- kanji1 = 0;
-- }
-- if (!kanji2 && ch > 127) {
-- kanji1 = 1;
--#if JIS
-- if (!inkanji) {
-- inkanji = 1;
-- fprintf(output, KANJIIN);
-- }
-- ch &= 0x7f;
--#endif
-- }
--#if JIS
-- if (!kanji1 && !kanji2 && inkanji) {
-- fprintf(output, KANJIOUT);
-- inkanji = 0;
-- }
--#endif
-- if (kanji1 && (j >= (int) foo) &&
-- (currentline->charactercount > i+1)) {
--#if JIS
-- if (inkanji)
-- fprintf(output, KANJIOUT);
--#endif
-- fprintf(output, "*\n"); /* if line to large */
-- fprintf(output, " *"); /* mark output */
--#if JIS
-- if (inkanji)
-- fprintf(output, KANJIIN);
--#endif
-- j = 2;
-- }
-- }
--
-- if (ch >= SPACE || allchar)
-- putc(ch, output);
-+ if (japan) {
-+ if (ch > 127) {
-+ for (k = 0; k < 4; k++) {
-+ if (i - leftmargin + k < LINELEN+1)
-+ buff[k] = currentline->text[i - leftmargin + k];
-+ else buff[k] = '\0';
-+ }
-+ kanji1 = multistrlen(buff, 4, 0) - 1;
-+ }
-+ else kanji1 = 0;
-+ if (kanji1 && (j + kanji1 > (int) foo) &&
-+ (currentline->charactercount > i+1)) {
-+ putc2('*', output);
-+ putc2('\n', output); /* if line to large */
-+ putc2(' ', output);
-+ putc2('*', output); /* mark output */
-+ j = 2;
-+ }
-+ }
-+
-+ if (ch >= SPACE || allchar) {
-+ if (japan) {
-+ for (k = 0; k < kanji1; k++) {
-+ putc2(ch, output);
-+ i++; j++;
-+ ch = currentline->text[i - leftmargin];
-+ }
-+ putc2(ch, output);
-+ }
-+ else
-+ putc(ch, output);
-+ }
- if ((j > (int) foo) && (currentline->charactercount > i+1)) {
--#if JIS
-- if (asciip && inkanji)
-- fprintf(output,KANJIOUT);
--#endif
-- fprintf(output, "*\n"); /* if line to large */
-- fprintf(output, " *"); /* mark output */
--#if JIS
-- if (asciip && inkanji)
-- fprintf(output, KANJIIN);
--#endif
-- j = 2;
-- }
-- if (asciip)
-- kanji2 = 0;
-+ if (japan) {
-+ putc2('*', output);
-+ putc2('\n', output); /* if line to large */
-+ putc2(' ', output);
-+ putc2('*', output); /* mark output */
-+ }
-+ else {
-+ fprintf(output, "*\n"); /* if line to large */
-+ fprintf(output, " *"); /* mark output */
-+ }
-+ j = 2;
-+ }
- }
- }
-- putc('\n', output);
-+ if (japan)
-+ putc2('\n', output);
-+ else
-+ putc('\n', output);
- }
-
--#if JIS
-- if (asciip && !kanji1 && !kanji2 && inkanji) {
-- fprintf(output, KANJIOUT);
-- inkanji = 0;
-- }
--#endif
--
- currentline = firstline;
- while (currentline->next != nil) {
- currentline = currentline->next;
-@@ -988,23 +961,19 @@
- * DOKANJI -- Process a kanji character opcode.
- */
-
--void dokanji(unsigned long ch)
-+void dokanji(long ch)
- {
--#if SJIS
-- register int c1, c2;
-+ long i;
-
-- c1 = (ch >> 8) & 0xff;
-- c2 = ch & 0xff;
-+ i = toBUFF(fromDVI(ch));
-+ kanji1 = 3;
-+ if (BYTE1(i) != 0) outchar(BYTE1(i));
-+ kanji1 = 2;
-+ if (BYTE2(i) != 0) outchar(BYTE2(i));
- kanji1 = 1;
-- outchar((((c1 - 1) >> 1) + ((c1 <= 0x5e) ? 0x71 : 0xb1)));
-+ /* always */ outchar(BYTE3(i));
- kanji1 = 0;
-- outchar((c2 + ((c1 & 1) ? ((c2 < 0x60) ? 0x1f : 0x20) : 0x7e)));
--#else
-- kanji1 = 1;
-- outchar(0x80 | ( ch >> 8 ));
-- kanji1 = 0;
-- outchar(ch & 0xff);
--#endif
-+ /* always */ outchar(BYTE4(i));
-
- return;
-
-@@ -1019,7 +988,7 @@
- void dochar(unsigned char ch)
- {
-
-- if (japan && fnt->fontnum)
-+ if (nttj && fnt->fontnum)
- jischar((long) ch);
- else if (symbolfont == TRUE)
- symchar(ch);
-@@ -1048,8 +1017,8 @@
- case 14: ch = 'O'; break;
- case 15: ch = 'o'; break;
- case 24: ch = '~'; break;
-- case 32: ch = japan ? '<' : 32; break; /* really only for japan? */
-- case 33: ch = japan ? '>' : 33; break; /* really only for japan? */
-+ case 32: ch = nttj ? '<' : 32; break; /* really only for japan? */
-+ case 33: ch = nttj ? '>' : 33; break; /* really only for japan? */
- case 102: ch = '{'; break;
- case 103: ch = '}'; break;
- case 104: ch = '<'; break;
-@@ -1284,6 +1253,14 @@
- /*----------------- end of 'latin1 / Scandinavian code' ----------------*/
-
- if (foo == leftmargin-1) {
-+ if (japan) {
-+ while (((currentline->text[j - leftmargin] != SPACE) ||
-+ (kanji1 && (currentline->text[j+kanji1 - leftmargin] != SPACE)))
-+ && (j < rightmargin)) {
-+ j++;
-+ h += charwidth;
-+ }
-+ } else {
- while (j < rightmargin &&
- ( (currentline->text[j - leftmargin] != SPACE) ||
- (kanji1 && (currentline->text[j+1 - leftmargin] != SPACE))
-@@ -1291,6 +1268,7 @@
- j++;
- h += charwidth;
- }
-+ }
- }
- if ( allchar || ((ch >= SPACE) && (ch != DEL)) ||
- ((latin1 || scascii) && (ch == 23)) ) {
-@@ -1321,7 +1299,7 @@
- register long saveh;
-
- saveh = h;
-- if (japan)
-+ if (nttj)
- dochar((unsigned char) charnr);
- else if (allchar || ((charnr >= 0) && (charnr <= LASTCHAR)))
- outchar((unsigned char) charnr);
-@@ -1351,6 +1329,43 @@
- } /* setchar */
-
-
-+static const char *ptex_fontchk[] = {
-+ "min", "goth", "jis",
-+ "hmin", "hgoth", "hmgoth", /* japanese-otf package */
-+ "nmlmin", "nmlgoth", "nmlmgoth",
-+ "hiramin", "hirakaku", "hiramaru",
-+ NULL /* end */
-+};
-+
-+static const char *uptex_fontchk[] = {
-+ "umin", "ugoth", "ujis",
-+ "upjis", "upjpn", "upsch", "uptch", "upkor",
-+ "uphmin", "uphgoth", "uphmgoth", /* japanese-otf package */
-+ "upnmlmin", "upnmlgoth", "upnmlmgoth",
-+ "uphiramin", "uphirakaku", "uphiramaru",
-+ NULL /* end */
-+};
-+
-+static const char *jtex_fontchk[] = {
-+ "dmj", "dgj",
-+ NULL /* end */
-+};
-+
-+static int checkjfont(const char **jfontlist, const char *name)
-+{
-+ int i, len;
-+ const char *tmpfont;
-+
-+ i=0;
-+ while ( (tmpfont=jfontlist[i]) != NULL ) {
-+ len=strlen(tmpfont);
-+ if ( !strncmp(tmpfont, name, len) ) return 1;
-+ i++;
-+ }
-+ return 0;
-+} /* checkjfont */
-+
-+
-
- /*
- * FONTDEF -- Process a font definition.
-@@ -1402,22 +1417,33 @@
- */
- fonts->flags = 0;
-
-- if (jautodetect && asciip == FALSE && japan == FALSE && !jdetect) {
-- if (!strncmp("min", name, 3) || !strncmp("got", name, 3)) {
-+ if ((asciip == FALSE && nttj == FALSE && uptex == FALSE)
-+ && (!jdetect) && jautodetect) {
-+ if ( checkjfont(ptex_fontchk, name) ) {
- /* Detect as ASCII TeX */
- asciip = TRUE;
-- japan = FALSE;
-- jdetect = TRUE;
-+ nttj = uptex = FALSE;
-+ japan = jdetect = TRUE;
-+ fonts->flags |= MIFONT;
-+ set_enc_string (NULL, PTEX_INTERNAL_ENC);
-+ } else if ( checkjfont(uptex_fontchk, name) ) {
-+ /* Detect as upTeX */
-+ uptex = TRUE;
-+ nttj = asciip = FALSE;
-+ japan = jdetect = TRUE;
- fonts->flags |= MIFONT;
-- } else if (!strncmp("dmj", name, 3) || !strncmp("dgj", name, 3)) {
-+ enable_UPTEX(true);
-+ set_enc_string (NULL, UPTEX_INTERNAL_ENC);
-+ } else if ( checkjfont(jtex_fontchk, name) ) {
- /* Detect as NTT JTeX */
-- asciip = FALSE;
-- japan = TRUE;
-- jdetect = TRUE;
-+ nttj = TRUE;
-+ asciip = uptex = FALSE;
-+ japan = jdetect = TRUE;
- fonts->flags |= JAPFONT;
-+ set_enc_string (NULL, JTEX_INTERNAL_ENC);
- }
- }
-- if (japan)
-+ if (nttj)
- fonts->fontnum = getjsubfont(name);
- else
- fonts->fontnum = 0;
-@@ -1511,7 +1537,9 @@
- unsigned int Ku, Ten;
-
- compute_jis(fnt->fontnum, (unsigned int) ch, &Ku, &Ten);
-+ kanji1 = 1;
- outchar(Ku+128);
-+ kanji1 = 0;
- outchar(Ten+128);
-
- return;
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-04-OpenSolaris b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-04-OpenSolaris
deleted file mode 100644
index 5c0cd147ab2..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-04-OpenSolaris
+++ /dev/null
@@ -1,27 +0,0 @@
- It seems that st.st_size yields garbage on 32-bit
- OpenSolaris/OpenIndiana with large file support.
-
-diff -ur dvi2tty-5.3.4.orig/dvistuff.c dvi2tty-5.3.4/dvistuff.c
---- dvi2tty-5.3.4.orig/dvistuff.c 2011-11-21 22:41:54.000000000 +0100
-+++ dvi2tty-5.3.4/dvistuff.c 2012-04-26 09:20:32.000000000 +0200
-@@ -276,15 +276,18 @@
- {
- register long size;
- register int count;
--#if !defined (THINK_C)
-+#if !defined (THINK_C) && defined(VMS)
- struct stat st;
- #endif
-
- #if defined (THINK_C)
- size = DVIfile->len;
--#else
-+#elif defined(VMS)
- fstat (fileno(DVIfile), &st);
- size = (long) st.st_size; /* get size of file */
-+#else
-+ fseek (DVIfile, 0L, SEEK_END);
-+ size = ftell (DVIfile); /* get size of file */
- #endif
-
- count = -1;
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-05-win32 b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-05-win32
deleted file mode 100644
index bf51b4889c2..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-05-win32
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.h dvi2tty-5.3.4/dvi2tty.h
---- dvi2tty-5.3.4.orig/dvi2tty.h 2011-11-21 22:28:42.000000000 +0100
-+++ dvi2tty-5.3.4/dvi2tty.h 2012-06-22 09:09:35.000000000 +0200
-@@ -28,7 +28,7 @@
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
--#if defined(MSDOS)
-+#if defined(MSDOS) || (defined(WIN32) && !defined(__MINGW32__))
- # include <malloc.h>
- #else
- # if !defined(THINK_C)
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-06-malloc b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-06-malloc
deleted file mode 100644
index 6933dc4514b..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-06-malloc
+++ /dev/null
@@ -1,70 +0,0 @@
-diff -ur dvi2tty-5.3.4.orig/disdvi.c dvi2tty-5.3.4/disdvi.c
---- dvi2tty-5.3.4.orig/disdvi.c 2010-11-13 16:31:14.000000000 +0100
-+++ dvi2tty-5.3.4/disdvi.c 2012-06-22 09:12:43.000000000 +0200
-@@ -193,7 +193,10 @@
- if ((i >= 5) && (!strcmp(*argv+i-4, dvi_ext)))
- dvi_name = *argv;
- else {
-- dvi_name = malloc((i+5) * sizeof(char));
-+ if ((dvi_name = malloc((i+5) * sizeof(char))) == NULL) {
-+ perror("dvi_name");
-+ exit(1);
-+ }
- strcpy(dvi_name, *argv);
- strcat(dvi_name, dvi_ext);
- }
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.c dvi2tty-5.3.4/dvi2tty.c
---- dvi2tty-5.3.4.orig/dvi2tty.c 2011-11-21 22:30:24.000000000 +0100
-+++ dvi2tty-5.3.4/dvi2tty.c 2012-06-22 10:12:43.000000000 +0200
-@@ -53,7 +53,6 @@
-
- /*------------------ end of customization constants ---------------------*/
-
--#define MAXLEN 100 /* size of char-arrays for strings */
- #if defined(MSDOS) || defined(VMS) || defined(AMIGA)
- #define OPTSET "haJweEpPousltvbcANU" /* legal options */
- #define OPTWARG "weEpPovb" /* options with argument */
-@@ -109,7 +108,7 @@
- char * progname; /* our name */
- int Argc;
- char ** Argv;
--char DVIfilename[MAXLEN];
-+char * DVIfilename;
- const char * OUTfilename;
- char optch; /* for option handling */
-
-@@ -483,7 +482,10 @@
- int num;
-
- pageswitchon = TRUE;
-- firstpage = (printlisttype *) malloc(sizeof(printlisttype));
-+ if ((firstpage = (printlisttype *) malloc(sizeof(printlisttype))) == NULL) {
-+ perror("firstpage");
-+ exit(1);
-+ }
- firstpage->all = FALSE;
- firstpage->nxt = nil;
- firstpage->pag = 0;
-@@ -543,7 +545,10 @@
-
- currentpage = lastpage;
- currentpage->pag = pagnr;
-- lastpage = (printlisttype *) malloc(sizeof(printlisttype));
-+ if ((lastpage = (printlisttype *) malloc(sizeof(printlisttype))) == NULL) {
-+ perror("lastpage");
-+ exit(1);
-+ }
- lastpage->all = FALSE;
- lastpage->nxt = nil;
- lastpage->pag = 0;
-@@ -566,6 +571,10 @@
- i = strlen(str);
- if (i == 0)
- usage(ign);
-+ if ((DVIfilename = (char *) malloc(i+5)) == NULL) {
-+ perror("DVIfilename");
-+ exit(1);
-+ }
- strcpy(DVIfilename, str);
- #ifdef KPATHSEA
- if (!kpse_readable_file(DVIfilename))
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-07-win32 b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-07-win32
deleted file mode 100644
index 826ee1ab667..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-07-win32
+++ /dev/null
@@ -1,57 +0,0 @@
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.c dvi2tty-5.3.4/dvi2tty.c
---- dvi2tty-5.3.4.orig/dvi2tty.c 2012-06-22 10:12:43.000000000 +0200
-+++ dvi2tty-5.3.4/dvi2tty.c 2012-09-06 21:51:41.000000000 +0200
-@@ -164,7 +164,11 @@
- Argc = argc;
- Argv = argv;
-
-+#ifdef WIN32
-+ set_enc_string ("sjis", "default");
-+#else
- set_enc_string (NULL, "default");
-+#endif
- getargs(); /* read command line arguments */
- #if defined(THINK_C)
- if (inputfromfile) {
-diff -ur dvi2tty-5.3.4.orig/dvistuff.c dvi2tty-5.3.4/dvistuff.c
---- dvi2tty-5.3.4.orig/dvistuff.c 2012-04-26 09:20:32.000000000 +0200
-+++ dvi2tty-5.3.4/dvistuff.c 2012-07-10 14:18:30.000000000 +0200
-@@ -970,13 +970,13 @@
-
- i = toBUFF(fromDVI(ch));
- kanji1 = 3;
-- if (BYTE1(i) != 0) outchar(BYTE1(i));
-+ if (BYTE1(i) != 0) outchar((unsigned char)BYTE1(i));
- kanji1 = 2;
-- if (BYTE2(i) != 0) outchar(BYTE2(i));
-+ if (BYTE2(i) != 0) outchar((unsigned char)BYTE2(i));
- kanji1 = 1;
-- /* always */ outchar(BYTE3(i));
-+ /* always */ outchar((unsigned char)BYTE3(i));
- kanji1 = 0;
-- /* always */ outchar(BYTE4(i));
-+ /* always */ outchar((unsigned char)BYTE4(i));
-
- return;
-
-@@ -1325,7 +1325,7 @@
- void setchar(long charnr)
- {
-
-- outchar(allchar ? (unsigned char) charnr : '#');
-+ outchar((unsigned char)(allchar ? charnr : '#'));
-
- return;
-
-@@ -1541,9 +1541,9 @@
-
- compute_jis(fnt->fontnum, (unsigned int) ch, &Ku, &Ten);
- kanji1 = 1;
-- outchar(Ku+128);
-+ outchar((unsigned char)(Ku+128));
- kanji1 = 0;
-- outchar(Ten+128);
-+ outchar((unsigned char)(Ten+128));
-
- return;
-
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-08-config_h b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-08-config_h
deleted file mode 100644
index 06c4230df28..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-08-config_h
+++ /dev/null
@@ -1,68 +0,0 @@
-diff -ur dvi2tty-5.3.4.orig/disdvi.c dvi2tty-5.3.4/disdvi.c
---- dvi2tty-5.3.4.orig/disdvi.c 2012-06-22 09:12:43.000000000 +0200
-+++ dvi2tty-5.3.4/disdvi.c 2013-06-28 15:02:13.000000000 +0200
-@@ -45,6 +45,12 @@
- * Include files
- */
-
-+#if defined(KPATHSEA)
-+# define NO_DEBUG 1
-+# include <kpathsea/config.h>
-+# include <kpathsea/lib.h>
-+#endif
-+
- #include <stdio.h>
- #include <stdlib.h>
- #if defined(MSDOS) || defined(WIN32)
-@@ -61,12 +67,6 @@
- # include "macintosh.h"
- #endif
-
--#if defined(KPATHSEA)
--# define NO_DEBUG 1
--# include <kpathsea/config.h>
--# include <kpathsea/lib.h>
--#endif
--
-
- /*
- * Constant definitions
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.h dvi2tty-5.3.4/dvi2tty.h
---- dvi2tty-5.3.4.orig/dvi2tty.h 2012-06-22 09:09:35.000000000 +0200
-+++ dvi2tty-5.3.4/dvi2tty.h 2013-06-28 15:02:13.000000000 +0200
-@@ -25,17 +25,6 @@
- Copyright (C) 1989-2010 M.J.E. Mol, MESA Consulting B.V."
-
-
--#include <stdio.h>
--#include <string.h>
--#include <stdlib.h>
--#if defined(MSDOS) || (defined(WIN32) && !defined(__MINGW32__))
--# include <malloc.h>
--#else
--# if !defined(THINK_C)
--# include <unistd.h>
--# endif
--#endif
--
- #if defined(KPATHSEA)
- # define NO_DEBUG 1
- # include <kpathsea/config.h>
-@@ -47,6 +36,17 @@
- # define FALSE 0
- #endif
-
-+#include <stdio.h>
-+#include <string.h>
-+#include <stdlib.h>
-+#if defined(MSDOS) || (defined(WIN32) && !defined(__MINGW32__))
-+# include <malloc.h>
-+#else
-+# if !defined(THINK_C)
-+# include <unistd.h>
-+# endif
-+#endif
-+
- #define nil NULL
-
- /*
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-09-win32 b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-09-win32
deleted file mode 100644
index cd1c4c30738..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-09-win32
+++ /dev/null
@@ -1,91 +0,0 @@
-diff -ur dvi2tty-5.3.4.orig/disdvi.c dvi2tty-5.3.4/disdvi.c
---- dvi2tty-5.3.4.orig/disdvi.c 2013-06-28 15:02:13.000000000 +0200
-+++ dvi2tty-5.3.4/disdvi.c 2014-02-01 06:40:06.000000000 +0100
-@@ -49,6 +49,9 @@
- # define NO_DEBUG 1
- # include <kpathsea/config.h>
- # include <kpathsea/lib.h>
-+#if defined(WIN32)
-+# include <kpathsea/variable.h>
-+#endif
- #endif
-
- #include <stdio.h>
-@@ -66,6 +69,10 @@
- #if defined(THINK_C)
- # include "macintosh.h"
- #endif
-+#if defined(WIN32) && defined(KPATHSEA)
-+#undef fopen
-+#define fopen fsyscp_fopen
-+#endif
-
-
- /*
-@@ -153,6 +160,17 @@
- register int i;
- unsigned long fontnum;
-
-+#if defined(WIN32) && defined(KPATHSEA)
-+ char **av, *enc;
-+ int ac;
-+ kpse_set_program_name(argv[0], "disdvi");
-+ enc = kpse_var_value("command_line_encoding");
-+ if (get_command_line_args_utf8(enc, &ac, &av)) {
-+ argv = av;
-+ argc = ac;
-+ }
-+#endif
-+
- #if defined(THINK_C)
- argc = process_disdvi_command_line(&argv);
- #endif
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.c dvi2tty-5.3.4/dvi2tty.c
---- dvi2tty-5.3.4.orig/dvi2tty.c 2012-09-06 21:51:41.000000000 +0200
-+++ dvi2tty-5.3.4/dvi2tty.c 2014-02-01 06:40:06.000000000 +0100
-@@ -31,6 +31,10 @@
- # include "macintosh.h"
- #endif
-
-+#if defined(WIN32) && defined(KPATHSEA)
-+#undef fopen
-+#define fopen fsyscp_fopen
-+#endif
-
-
- /*
-@@ -155,6 +159,9 @@
- int main(int argc, char **argv)
- #endif
- {
-+#if defined(WIN32) && defined(KPATHSEA)
-+ char *enc;
-+#endif
-
- #if defined(THINK_C)
- argc = process_dvi_command_line(&argv);
-@@ -163,6 +170,11 @@
- progname = *argv;
- Argc = argc;
- Argv = argv;
-+#if defined(WIN32) && defined(KPATHSEA)
-+ kpse_set_program_name(argv[0], "dvi2tty");
-+ enc = kpse_var_value("command_line_encoding");
-+ get_command_line_args_utf8(enc, &Argc, &Argv);
-+#endif
-
- #ifdef WIN32
- set_enc_string ("sjis", "default");
-diff -ur dvi2tty-5.3.4.orig/dvi2tty.h dvi2tty-5.3.4/dvi2tty.h
---- dvi2tty-5.3.4.orig/dvi2tty.h 2013-06-28 15:02:13.000000000 +0200
-+++ dvi2tty-5.3.4/dvi2tty.h 2014-02-01 06:40:06.000000000 +0100
-@@ -29,6 +29,9 @@
- # define NO_DEBUG 1
- # include <kpathsea/config.h>
- # include <kpathsea/readable.h>
-+#if defined(WIN32)
-+# include <kpathsea/variable.h>
-+#endif
- # include <sys/types.h>
- # include <sys/stat.h>
- #else
diff --git a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-10-ChangeLog b/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-10-ChangeLog
deleted file mode 100644
index 65250d50771..00000000000
--- a/Build/source/texk/dvi2tty/dvi2tty-PATCHES/patch-10-ChangeLog
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -ur dvi2tty-5.3.4.orig/Changelog dvi2tty-5.3.4/Changelog
---- dvi2tty-5.3.4.orig/Changelog 2011-11-21 19:56:42.000000000 +0100
-+++ dvi2tty-5.3.4/Changelog 2015-04-17 01:31:19.000000000 +0200
-@@ -150,15 +150,5 @@
- * Edit: Svante Lindahl
- *
- * dvitty - get an ascii representation of a dvi-file, suitable for ttys
-- *
-- * This program, and any documentation for it, is copyrighted by Svante
-- * Lindahl. It may be copied for non-commercial use only, provided that
-- * any and all copyright notices are preserved.
-- *
-- *
-- * UUCP: {seismo,mcvax,cernvax,diku,ukc,unido}!enea!ttds!zap
-- * ARPA: enea!ttds!zap@seismo.CSS.GOV
-- * or Svante_Lindahl_NADA%QZCOM.MAILNET@MIT-MULTICS.ARPA
-- * EAN: zap@cs.kth.sunet
- */
-