summaryrefslogtreecommitdiff
path: root/print/teTeX3-bin/patches
diff options
context:
space:
mode:
authormarkd <markd@pkgsrc.org>2015-04-30 10:43:54 +0000
committermarkd <markd@pkgsrc.org>2015-04-30 10:43:54 +0000
commit44b7b2674090b0f70f8a641552aee88c3193fc43 (patch)
tree9674974804ef906216fae6033cce783f3307ebbf /print/teTeX3-bin/patches
parentf1df5535130c6f296c448a4f15d1539fd089c4aa (diff)
downloadpkgsrc-44b7b2674090b0f70f8a641552aee88c3193fc43.tar.gz
Convert to meta package.
The only remaining files in the PLIST were symlinks in bin for commands that didn't actually work. Plus some related documentation.
Diffstat (limited to 'print/teTeX3-bin/patches')
-rw-r--r--print/teTeX3-bin/patches/patch-aa23
-rw-r--r--print/teTeX3-bin/patches/patch-ab196
-rw-r--r--print/teTeX3-bin/patches/patch-ae12
-rw-r--r--print/teTeX3-bin/patches/patch-af36
-rw-r--r--print/teTeX3-bin/patches/patch-ag38
-rw-r--r--print/teTeX3-bin/patches/patch-ah21
-rw-r--r--print/teTeX3-bin/patches/patch-ai75
-rw-r--r--print/teTeX3-bin/patches/patch-aj37
-rw-r--r--print/teTeX3-bin/patches/patch-ak67
-rw-r--r--print/teTeX3-bin/patches/patch-al121
-rw-r--r--print/teTeX3-bin/patches/patch-am82
-rw-r--r--print/teTeX3-bin/patches/patch-an13
-rw-r--r--print/teTeX3-bin/patches/patch-aq69
-rw-r--r--print/teTeX3-bin/patches/patch-ar22
-rw-r--r--print/teTeX3-bin/patches/patch-as112
-rw-r--r--print/teTeX3-bin/patches/patch-at1893
-rw-r--r--print/teTeX3-bin/patches/patch-au106
-rw-r--r--print/teTeX3-bin/patches/patch-av67
-rw-r--r--print/teTeX3-bin/patches/patch-aw17
-rw-r--r--print/teTeX3-bin/patches/patch-ax112
-rw-r--r--print/teTeX3-bin/patches/patch-ay13
-rw-r--r--print/teTeX3-bin/patches/patch-az22
-rw-r--r--print/teTeX3-bin/patches/patch-ba15
-rw-r--r--print/teTeX3-bin/patches/patch-bb19
-rw-r--r--print/teTeX3-bin/patches/patch-bc19
25 files changed, 0 insertions, 3207 deletions
diff --git a/print/teTeX3-bin/patches/patch-aa b/print/teTeX3-bin/patches/patch-aa
deleted file mode 100644
index df37505e106..00000000000
--- a/print/teTeX3-bin/patches/patch-aa
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-aa,v 1.2 2009/01/08 22:09:35 minskim Exp $
-
---- texk/configure.in.orig 2004-05-12 13:32:37.000000000 -0700
-+++ texk/configure.in
-@@ -9,7 +9,7 @@ dnl Consequence: we don't need to run co
- dnl itself; we can just copy from a program directory. We'll use the
- dnl first one.
- dnl
--AC_INIT(kpathsea/kpathsea.texi)
-+AC_INIT(web2c/tex.web)
-
- dnl These configure scripts won't work with anything else.
- AC_PREREQ(2.13)
-@@ -29,6 +29,9 @@ dnl Pass this down from the top level so
- dnl install kpathsea a command line value is propagated.
- AC_PROG_INSTALL
-
-+AC_CONFIG_HEADER(ac_config.h)
-+AC_HEADER_SYS_WAIT
-+
- dnl If the other programs ever acquire their own --with or --enable
- dnl options, they must be added, so configure --help at the top level
- dnl will show all the options.
diff --git a/print/teTeX3-bin/patches/patch-ab b/print/teTeX3-bin/patches/patch-ab
deleted file mode 100644
index 77247e26783..00000000000
--- a/print/teTeX3-bin/patches/patch-ab
+++ /dev/null
@@ -1,196 +0,0 @@
-$NetBSD: patch-ab,v 1.2 2009/01/08 22:09:35 minskim Exp $
-
---- texk/configure.orig 2005-02-06 10:27:03.000000000 -0800
-+++ texk/configure
-@@ -774,7 +774,7 @@ echo > confdefs.h
-
- # A filename unique to this package, relative to the directory that
- # configure is in, which we can look for to find out if srcdir is correct.
--ac_unique_file=kpathsea/kpathsea.texi
-+ac_unique_file=web2c/tex.web
-
- # Find the source files, if location was not specified.
- if test -z "$srcdir"; then
-@@ -1463,6 +1463,50 @@ test -z "$INSTALL_DATA" && INSTALL_DATA=
- # as few characters as possible. Prefer GNU sed if found.
-
-
-+echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-+echo "configure:1070: checking for sys/wait.h that is POSIX.1 compatible" >&5
-+if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 1075 "configure"
-+#include "confdefs.h"
-+#include <sys/types.h>
-+#include <sys/wait.h>
-+#ifndef WEXITSTATUS
-+#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-+#endif
-+#ifndef WIFEXITED
-+#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-+#endif
-+int main() {
-+int s;
-+wait (&s);
-+s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
-+; return 0; }
-+EOF
-+if { (eval echo configure:1091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+ rm -rf conftest*
-+ ac_cv_header_sys_wait_h=yes
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ ac_cv_header_sys_wait_h=no
-+fi
-+rm -f conftest*
-+fi
-+
-+echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
-+if test $ac_cv_header_sys_wait_h = yes; then
-+ cat >> confdefs.h <<\EOF
-+#define HAVE_SYS_WAIT_H 1
-+EOF
-+
-+fi
-+
-+
-+
-
- # Check whether --with-bibtex8 or --without-bibtex8 was given.
- if test "${with_bibtex8+set}" = set; then
-@@ -6697,6 +6741,8 @@ for ac_option
- do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-+ : Avoid regenerating within pkgsrc
-+ exit 0
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-@@ -6711,7 +6757,7 @@ done
- ac_given_srcdir=$srcdir
- ac_given_INSTALL="$INSTALL"
-
--trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-+trap 'rm -fr `echo "Makefile ac_config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
- EOF
- cat >> $CONFIG_STATUS <<EOF
-
-@@ -6913,6 +6959,113 @@ s%@INSTALL@%$INSTALL%g
- fi; done
- rm -f conftest.s*
-
-+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-+# NAME is the cpp macro being defined and VALUE is the value it is being given.
-+#
-+# ac_d sets the value in "#define NAME VALUE" lines.
-+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-+ac_dC='\3'
-+ac_dD='%g'
-+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-+ac_uB='\([ ]\)%\1#\2define\3'
-+ac_uC=' '
-+ac_uD='\4%g'
-+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-+ac_eB='$%\1#\2define\3'
-+ac_eC=' '
-+ac_eD='%g'
-+
-+if test "${CONFIG_HEADERS+set}" != set; then
-+EOF
-+cat >> $CONFIG_STATUS <<EOF
-+ CONFIG_HEADERS="ac_config.h"
-+EOF
-+cat >> $CONFIG_STATUS <<\EOF
-+fi
-+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
-+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-+ case "$ac_file" in
-+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
-+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-+ *) ac_file_in="${ac_file}.in" ;;
-+ esac
-+
-+ echo creating $ac_file
-+
-+ rm -f conftest.frag conftest.in conftest.out
-+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
-+ cat $ac_file_inputs > conftest.in
-+
-+EOF
-+
-+# Transform confdefs.h into a sed script conftest.vals that substitutes
-+# the proper values into ac_config.h.in to produce ac_config.h. And first:
-+# Protect against being on the right side of a sed subst in config.status.
-+# Protect against being in an unquoted here document in config.status.
-+rm -f conftest.vals
-+cat > conftest.hdr <<\EOF
-+s/[\\&%]/\\&/g
-+s%[\\$`]%\\&%g
-+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-+s%ac_d%ac_u%gp
-+s%ac_u%ac_e%gp
-+EOF
-+sed -n -f conftest.hdr confdefs.h > conftest.vals
-+rm -f conftest.hdr
-+
-+# This sed command replaces #undef with comments. This is necessary, for
-+# example, in the case of _POSIX_SOURCE, which is predefined and required
-+# on some systems where configure will not decide to define it.
-+cat >> conftest.vals <<\EOF
-+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-+EOF
-+
-+# Break up conftest.vals because some shells have a limit on
-+# the size of here documents, and old seds have small limits too.
-+
-+rm -f conftest.tail
-+while :
-+do
-+ ac_lines=`grep -c . conftest.vals`
-+ # grep -c gives empty output for an empty file on some AIX systems.
-+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
-+ # Write a limited-size here document to conftest.frag.
-+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
-+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
-+ echo 'CEOF
-+ sed -f conftest.frag conftest.in > conftest.out
-+ rm -f conftest.in
-+ mv conftest.out conftest.in
-+' >> $CONFIG_STATUS
-+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
-+ rm -f conftest.vals
-+ mv conftest.tail conftest.vals
-+done
-+rm -f conftest.vals
-+
-+cat >> $CONFIG_STATUS <<\EOF
-+ rm -f conftest.frag conftest.h
-+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
-+ cat conftest.in >> conftest.h
-+ rm -f conftest.in
-+ if cmp -s $ac_file conftest.h 2>/dev/null; then
-+ echo "$ac_file is unchanged"
-+ rm -f conftest.h
-+ else
-+ # Remove last slash and all that follows it. Not all systems have dirname.
-+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
-+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-+ # The file is in a subdirectory.
-+ test ! -d "$ac_dir" && mkdir "$ac_dir"
-+ fi
-+ rm -f $ac_file
-+ mv conftest.h $ac_file
-+ fi
-+fi; done
-+
- EOF
- cat >> $CONFIG_STATUS <<EOF
-
diff --git a/print/teTeX3-bin/patches/patch-ae b/print/teTeX3-bin/patches/patch-ae
deleted file mode 100644
index eea3021089d..00000000000
--- a/print/teTeX3-bin/patches/patch-ae
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-ae,v 1.1.1.1 2005/03/31 22:09:18 hubertf Exp $
-
---- texk/ac_config.h.in.orig Sun Oct 10 22:15:08 2004
-+++ texk/ac_config.h.in
-@@ -0,0 +1,7 @@
-+/* ac_config.h.in. Generated automatically from configure.in by autoheader. */
-+
-+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-+#undef HAVE_SYS_WAIT_H
-+
-+/* Define if you need to in order for stat and other things to work. */
-+#undef _POSIX_SOURCE
diff --git a/print/teTeX3-bin/patches/patch-af b/print/teTeX3-bin/patches/patch-af
deleted file mode 100644
index bc4c6dfb9db..00000000000
--- a/print/teTeX3-bin/patches/patch-af
+++ /dev/null
@@ -1,36 +0,0 @@
-$NetBSD: patch-af,v 1.1.1.1 2005/03/31 22:09:18 hubertf Exp $
-
---- texk/web2c/lib/coredump.c.orig Thu Jan 16 13:51:12 1997
-+++ texk/web2c/lib/coredump.c
-@@ -9,6 +9,7 @@
- you. Perl has some things to say about these days. */
-
- #include "config.h"
-+#include "ac_config.h"
-
- /* Do not try to compile this Unix-y unportable stuff unless it's needed. */
-
-@@ -29,7 +30,11 @@ funny_core_dump P1H(void)
- }
- #else /* !__EMX__ */
- int pid, w;
-+#ifdef HAVE_SYS_WAIT_H
-+ int status;
-+#else
- union wait status;
-+#endif
-
- switch (pid = fork ())
- {
-@@ -48,7 +53,11 @@ funny_core_dump P1H(void)
- default: /* parent */
- while ((w = wait (&status)) != pid && w != -1)
- ;
-+#ifdef HAVE_SYS_WAIT_H
-+ if (WCOREDUMP(status))
-+#else
- if (status.w_coredump)
-+#endif
- exit (0);
- (void) write (2, "attempt to dump core failed\n", 28);
- exit (1);
diff --git a/print/teTeX3-bin/patches/patch-ag b/print/teTeX3-bin/patches/patch-ag
deleted file mode 100644
index 0f86bcf9092..00000000000
--- a/print/teTeX3-bin/patches/patch-ag
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD: patch-ag,v 1.1 2006/01/24 21:51:36 tron Exp $
-
---- libs/xpdf/xpdf/JPXStream.cc.orig 2004-01-22 01:26:45.000000000 +0000
-+++ libs/xpdf/xpdf/JPXStream.cc 2006-01-24 18:32:17.000000000 +0000
-@@ -7,6 +7,7 @@
- //========================================================================
-
- #include <aconf.h>
-+#include <limits.h>
-
- #ifdef USE_GCC_PRAGMAS
- #pragma implementation
-@@ -666,7 +667,7 @@
- int segType;
- GBool haveSIZ, haveCOD, haveQCD, haveSOT;
- Guint precinctSize, style;
-- Guint segLen, capabilities, comp, i, j, r;
-+ Guint segLen, capabilities, nTiles, comp, i, j, r;
-
- //----- main header
- haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
-@@ -701,8 +702,14 @@
- / img.xTileSize;
- img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
- / img.yTileSize;
-- img.tiles = (JPXTile *)gmalloc(img.nXTiles * img.nYTiles *
-- sizeof(JPXTile));
-+ // check for overflow before allocating memory
-+ if (img.nXTiles <= 0 || img.nYTiles <= 0 ||
-+ img.nXTiles >= INT_MAX/img.nYTiles) {
-+ error(getPos(), "Bad tile count in JPX SIZ marker segment");
-+ return gFalse;
-+ }
-+ nTiles = img.nXTiles * img.nYTiles;
-+ img.tiles = (JPXTile *)gmalloc(nTiles * sizeof(JPXTile));
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
- img.tiles[i].tileComps = (JPXTileComp *)gmalloc(img.nComps *
- sizeof(JPXTileComp));
diff --git a/print/teTeX3-bin/patches/patch-ah b/print/teTeX3-bin/patches/patch-ah
deleted file mode 100644
index 1dc70c0ff48..00000000000
--- a/print/teTeX3-bin/patches/patch-ah
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-ah,v 1.1 2006/01/24 21:51:36 tron Exp $
-
---- libs/xpdf/xpdf/Stream.h.orig 2004-01-22 01:26:45.000000000 +0000
-+++ libs/xpdf/xpdf/Stream.h 2006-01-24 18:44:04.000000000 +0000
-@@ -233,6 +233,8 @@
-
- ~StreamPredictor();
-
-+ GBool isOk() { return ok; }
-+
- int lookChar();
- int getChar();
-
-@@ -250,6 +252,7 @@
- int rowBytes; // bytes per line
- Guchar *predLine; // line buffer
- int predIdx; // current index in predLine
-+ GBool ok;
- };
-
- //------------------------------------------------------------------------
diff --git a/print/teTeX3-bin/patches/patch-ai b/print/teTeX3-bin/patches/patch-ai
deleted file mode 100644
index a4f4e6fd965..00000000000
--- a/print/teTeX3-bin/patches/patch-ai
+++ /dev/null
@@ -1,75 +0,0 @@
-$NetBSD: patch-ai,v 1.1 2006/01/24 21:51:36 tron Exp $
-
---- libs/xpdf/xpdf/JBIG2Stream.cc.orig 2004-01-22 01:26:45.000000000 +0000
-+++ libs/xpdf/xpdf/JBIG2Stream.cc 2006-01-24 18:51:43.000000000 +0000
-@@ -7,6 +7,7 @@
- //========================================================================
-
- #include <aconf.h>
-+#include <limits.h>
-
- #ifdef USE_GCC_PRAGMAS
- #pragma implementation
-@@ -681,7 +682,13 @@
- w = wA;
- h = hA;
- line = (wA + 7) >> 3;
-- data = (Guchar *)gmalloc(h * line);
-+
-+ if (h < 0 || line <= 0 || h >= INT_MAX / line) {
-+ data = NULL;
-+ }
-+ else {
-+ data = (Guchar *)gmalloc(h * line);
-+ }
- }
-
- JBIG2Bitmap::JBIG2Bitmap(Guint segNumA, JBIG2Bitmap *bitmap):
-@@ -690,6 +697,12 @@
- w = bitmap->w;
- h = bitmap->h;
- line = bitmap->line;
-+
-+ if (h < 0 || line <= 0 || h >= INT_MAX / line) {
-+ data = NULL;
-+ return;
-+ }
-+
- data = (Guchar *)gmalloc(h * line);
- memcpy(data, bitmap->data, h * line);
- }
-@@ -716,7 +729,7 @@
- }
-
- void JBIG2Bitmap::expand(int newH, Guint pixel) {
-- if (newH <= h) {
-+ if (newH <= h || line <= 0 || newH >= INT_MAX / line) {
- return;
- }
- data = (Guchar *)grealloc(data, newH * line);
-@@ -2256,6 +2269,15 @@
- error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment");
- return;
- }
-+ if (gridH == 0 || gridW >= INT_MAX / gridH) {
-+ error(getPos(), "Bad size in JBIG2 halftone segment");
-+ return;
-+ }
-+ if (w == 0 || h >= INT_MAX / w) {
-+ error(getPos(), "Bad size in JBIG2 bitmap segment");
-+ return;
-+ }
-+
- patternDict = (JBIG2PatternDict *)seg;
- bpp = 0;
- i = 1;
-@@ -2887,6 +2909,9 @@
- JBIG2BitmapPtr tpgrCXPtr0, tpgrCXPtr1, tpgrCXPtr2;
- int x, y, pix;
-
-+ if (w < 0 || h <= 0 || w >= INT_MAX / h)
-+ return NULL;
-+
- bitmap = new JBIG2Bitmap(0, w, h);
- bitmap->clearToZero();
-
diff --git a/print/teTeX3-bin/patches/patch-aj b/print/teTeX3-bin/patches/patch-aj
deleted file mode 100644
index 87022ae50da..00000000000
--- a/print/teTeX3-bin/patches/patch-aj
+++ /dev/null
@@ -1,37 +0,0 @@
-$NetBSD: patch-aj,v 1.1.1.1 2005/03/31 22:09:18 hubertf Exp $
-
---- libs/xpdf/xpdf/Catalog.cc.orig 2004-01-22 01:26:45.000000000 +0000
-+++ libs/xpdf/xpdf/Catalog.cc
-@@ -22,6 +22,7 @@
- #include "Error.h"
- #include "Link.h"
- #include "Catalog.h"
-+#include <limits.h>
-
- //------------------------------------------------------------------------
- // Catalog
-@@ -64,6 +65,12 @@ Catalog::Catalog(XRef *xrefA) {
- }
- pagesSize = numPages0 = (int)obj.getNum();
- obj.free();
-+ if ((pagesSize >= INT_MAX / sizeof(Page *)) ||
-+ (pagesSize >= INT_MAX / sizeof(Ref))) {
-+ error(-1, "Invalid 'pagesSize'");
-+ ok = gFalse;
-+ return;
-+ }
- pages = (Page **)gmalloc(pagesSize * sizeof(Page *));
- pageRefs = (Ref *)gmalloc(pagesSize * sizeof(Ref));
- for (i = 0; i < pagesSize; ++i) {
-@@ -191,6 +198,11 @@ int Catalog::readPageTree(Dict *pagesDic
- }
- if (start >= pagesSize) {
- pagesSize += 32;
-+ if ((pagesSize >= INT_MAX/sizeof(Page *)) ||
-+ (pagesSize >= INT_MAX/sizeof(Ref))) {
-+ error(-1, "Invalid 'pagesSize' parameter.");
-+ goto err3;
-+ }
- pages = (Page **)grealloc(pages, pagesSize * sizeof(Page *));
- pageRefs = (Ref *)grealloc(pageRefs, pagesSize * sizeof(Ref));
- for (j = pagesSize - 32; j < pagesSize; ++j) {
diff --git a/print/teTeX3-bin/patches/patch-ak b/print/teTeX3-bin/patches/patch-ak
deleted file mode 100644
index 63a38848477..00000000000
--- a/print/teTeX3-bin/patches/patch-ak
+++ /dev/null
@@ -1,67 +0,0 @@
-$NetBSD: patch-ak,v 1.1.1.1 2005/03/31 22:09:18 hubertf Exp $
-
---- libs/xpdf/xpdf/XRef.cc.orig 2005-01-19 12:09:57.000000000 +0000
-+++ libs/xpdf/xpdf/XRef.cc
-@@ -28,6 +28,7 @@
- #include "Error.h"
- #include "ErrorCodes.h"
- #include "XRef.h"
-+#include <limits.h>
-
- //------------------------------------------------------------------------
-
-@@ -388,6 +389,10 @@ GBool XRef::readXRefTable(Parser *parser
- if (newSize < 0) {
- goto err1;
- }
-+ if (newSize >= INT_MAX/sizeof(XRefEntry)) {
-+ error(-1, "Invalid 'newSize'");
-+ goto err1;
-+ }
- entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry));
- for (i = size; i < newSize; ++i) {
- entries[i].offset = 0xffffffff;
-@@ -493,6 +498,10 @@ GBool XRef::readXRefStream(Stream *xrefS
- goto err1;
- }
- if (newSize > size) {
-+ if (newSize >= INT_MAX/sizeof(XRefEntry)) {
-+ error(-1, "Invalid 'newSize'");
-+ goto err1;
-+ }
- entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry));
- for (i = size; i < newSize; ++i) {
- entries[i].offset = 0xffffffff;
-@@ -583,6 +592,10 @@ GBool XRef::readXRefStreamSection(Stream
- if (newSize < 0) {
- return gFalse;
- }
-+ if (newSize >= INT_MAX / sizeof(XRefEntry)) {
-+ error(-1, "Invalid 'obj' parameters.");
-+ return gFalse;
-+ }
- entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry));
- for (i = size; i < newSize; ++i) {
- entries[i].offset = 0xffffffff;
-@@ -718,6 +731,10 @@ GBool XRef::constructXRef() {
- error(-1, "Bad object number");
- return gFalse;
- }
-+ if (newSize >= INT_MAX / sizeof(XRefEntry)) {
-+ error(-1, "Invalid 'newSize' parameters.");
-+ return gFalse;
-+ }
- entries = (XRefEntry *)
- grealloc(entries, newSize * sizeof(XRefEntry));
- for (i = size; i < newSize; ++i) {
-@@ -741,6 +758,10 @@ GBool XRef::constructXRef() {
- } else if (!strncmp(p, "endstream", 9)) {
- if (streamEndsLen == streamEndsSize) {
- streamEndsSize += 64;
-+ if (streamEndsSize >= INT_MAX/sizeof(int)) {
-+ error(-1, "Invalid 'streamEndSize' parameter.");
-+ return gFalse;
-+ }
- streamEnds = (Guint *)grealloc(streamEnds,
- streamEndsSize * sizeof(int));
- }
diff --git a/print/teTeX3-bin/patches/patch-al b/print/teTeX3-bin/patches/patch-al
deleted file mode 100644
index 700095b579f..00000000000
--- a/print/teTeX3-bin/patches/patch-al
+++ /dev/null
@@ -1,121 +0,0 @@
-$NetBSD: patch-al,v 1.1 2006/01/24 21:51:36 tron Exp $
-
---- libs/xpdf/xpdf/Stream.cc.orig 2004-01-22 01:26:45.000000000 +0000
-+++ libs/xpdf/xpdf/Stream.cc 2006-01-24 21:37:45.000000000 +0000
-@@ -15,6 +15,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <stddef.h>
-+#include <limits.h>
- #ifndef WIN32
- #include <unistd.h>
- #endif
-@@ -412,13 +413,28 @@
- width = widthA;
- nComps = nCompsA;
- nBits = nBitsA;
-+ predLine = NULL;
-+ ok = gFalse;
-
-+ if (width <= 0 || nComps <= 0 || nBits <= 0 ||
-+ nComps >= INT_MAX/nBits ||
-+ width >= INT_MAX/nComps/nBits) {
-+ return;
-+ }
- nVals = width * nComps;
-+ if (nVals * nBits + 7 <= 0) {
-+ return;
-+ }
- pixBytes = (nComps * nBits + 7) >> 3;
- rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
-+ if (rowBytes < 0) {
-+ return;
-+ }
- predLine = (Guchar *)gmalloc(rowBytes);
- memset(predLine, 0, rowBytes);
- predIdx = rowBytes;
-+
-+ ok = gTrue;
- }
-
- StreamPredictor::~StreamPredictor() {
-@@ -1012,6 +1028,10 @@
- FilterStream(strA) {
- if (predictor != 1) {
- pred = new StreamPredictor(this, predictor, columns, colors, bits);
-+ if (!pred->isOk()) {
-+ delete pred;
-+ pred = NULL;
-+ }
- } else {
- pred = NULL;
- }
-@@ -1260,6 +1280,9 @@
- endOfLine = endOfLineA;
- byteAlign = byteAlignA;
- columns = columnsA;
-+ if (columns + 3 < 1 || columns + 4 < 1 || columns < 1) {
-+ columns = 1;
-+ }
- rows = rowsA;
- endOfBlock = endOfBlockA;
- black = blackA;
-@@ -2897,6 +2920,10 @@
- height = read16();
- width = read16();
- numComps = str->getChar();
-+ if (numComps <= 0 || numComps > 4) {
-+ error(getPos(), "Bad number of components in DCT stream", prec);
-+ return gFalse;
-+ }
- if (prec != 8) {
- error(getPos(), "Bad DCT precision %d", prec);
- return gFalse;
-@@ -2923,6 +2950,10 @@
- height = read16();
- width = read16();
- numComps = str->getChar();
-+ if (numComps <= 0 || numComps > 4) {
-+ error(getPos(), "Bad number of components in DCT stream", prec);
-+ return gFalse;
-+ }
- if (prec != 8) {
- error(getPos(), "Bad DCT precision %d", prec);
- return gFalse;
-@@ -2945,6 +2976,10 @@
-
- length = read16() - 2;
- scanInfo.numComps = str->getChar();
-+ if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) {
-+ error(getPos(), "Bad number of components in DCT stream");
-+ return gFalse;
-+ }
- --length;
- if (length != 2 * scanInfo.numComps + 3) {
- error(getPos(), "Bad DCT scan info block");
-@@ -3019,12 +3054,12 @@
- while (length > 0) {
- index = str->getChar();
- --length;
-- if ((index & 0x0f) >= 4) {
-+ if ((index & ~0x10) >= 4 || (index & ~0x10) < 0) {
- error(getPos(), "Bad DCT Huffman table");
- return gFalse;
- }
- if (index & 0x10) {
-- index &= 0x0f;
-+ index &= 0x03;
- if (index >= numACHuffTables)
- numACHuffTables = index+1;
- tbl = &acHuffTables[index];
-@@ -3255,6 +3290,10 @@
- FilterStream(strA) {
- if (predictor != 1) {
- pred = new StreamPredictor(this, predictor, columns, colors, bits);
-+ if (!pred->isOk()) {
-+ delete pred;
-+ pred = NULL;
-+ }
- } else {
- pred = NULL;
- }
diff --git a/print/teTeX3-bin/patches/patch-am b/print/teTeX3-bin/patches/patch-am
deleted file mode 100644
index 678ed0e957f..00000000000
--- a/print/teTeX3-bin/patches/patch-am
+++ /dev/null
@@ -1,82 +0,0 @@
-$NetBSD: patch-am,v 1.1 2008/05/05 22:48:22 tonnerre Exp $
-
---- texk/dvipsk/hps.c
-+++ texk/dvipsk/hps.c
-@@ -441,19 +441,28 @@ int href_name_match P2C(char *, h, char
-
- void stamp_hps P1C(Hps_link *, pl)
- {
-- char tmpbuf[200] ;
-+ char * tmpbuf;
- if (pl == NULL) {
-- error("Null pointer, oh no!") ;
-+ error("stamp_hps: null pl pointer, oh no!") ;
- return ;
-- } else {
-- /* print out the proper pdfm with local page info only
-- * target info will be in the target dictionary */
-- (void)sprintf(tmpbuf,
-- " (%s) [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] pdfm ", pl->title, pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
-- pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
-- pl->color[0], pl->color[1], pl->color[2]) ;
-- cmdout(tmpbuf) ;
-- }
-+ }
-+ if(pl->title == NULL) {
-+ error("stamp_hps: null pl->title pointer, oh no!") ;
-+ return ;
-+ }
-+
-+ tmpbuf = (char *) xmalloc(strlen(pl->title)+200);
-+
-+ /* print out the proper pdfm with local page info only
-+ * target info will be in the target dictionary */
-+ (void)sprintf(tmpbuf,
-+ " (%s) [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] pdfm ",
-+ pl->title, pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
-+ pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
-+ pl->color[0], pl->color[1], pl->color[2]) ;
-+ cmdout(tmpbuf) ;
-+ free(tmpbuf);
-+
-
- }
-
-@@ -462,18 +471,27 @@ void stamp_hps P1C(Hps_link *, pl)
- */
- void stamp_external P2C(char *, s, Hps_link *, pl)
- {
-- char tmpbuf[200];
-+ char *tmpbuf;
- if (pl == NULL) {
-- error("Null pointer, oh no!") ;
-+ error("stamp_external: null pl pointer, oh no!") ;
- return ;
-- } else {
-- /* print out the proper pdfm with local page info only
-- * target info will be in the target dictionary */
-- (void)sprintf(tmpbuf," [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] (%s) pdfm ", pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
-- pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
-- pl->color[0], pl->color[1], pl->color[2], s) ;
-- cmdout(tmpbuf) ;
-- }
-+ }
-+
-+ if (s == NULL) {
-+ error("stamp_external: null s pointer, oh no!") ;
-+ return ;
-+ }
-+
-+ tmpbuf = (char *) xmalloc(strlen(s) + 200);
-+
-+ /* print out the proper pdfm with local page info only
-+ * target info will be in the target dictionary */
-+ (void)sprintf(tmpbuf," [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] (%s) pdfm ",
-+ pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury,
-+ pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4],
-+ pl->color[0], pl->color[1], pl->color[2], s) ;
-+ cmdout(tmpbuf) ;
-+ free(tmpbuf);
- }
-
- void finish_hps P1H(void) {
diff --git a/print/teTeX3-bin/patches/patch-an b/print/teTeX3-bin/patches/patch-an
deleted file mode 100644
index a47385412d9..00000000000
--- a/print/teTeX3-bin/patches/patch-an
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-an,v 1.1 2008/05/05 22:48:22 tonnerre Exp $
-
---- texk/dviljk/configure.in.orig 1999-02-08 22:42:01.000000000 +0100
-+++ texk/dviljk/configure.in
-@@ -14,6 +14,8 @@ dnl These tests prevent reliable cross-c
- AC_C_CHAR_UNSIGNED
- AC_CHECK_SIZEOF(long)
-
-+AC_CHECK_FUNCS(rmdir unlink mkdtemp)
-+
- AC_OUTPUT(Makefile)
- dnl Update stamp-auto, since we just remade `c-auto.h'.
- date >stamp-auto
diff --git a/print/teTeX3-bin/patches/patch-aq b/print/teTeX3-bin/patches/patch-aq
deleted file mode 100644
index f18f908edd2..00000000000
--- a/print/teTeX3-bin/patches/patch-aq
+++ /dev/null
@@ -1,69 +0,0 @@
-$NetBSD: patch-aq,v 1.3 2013/11/13 19:02:25 minskim Exp $
-
---- Makefile.in.orig 2005-01-29 23:12:25.000000000 +0000
-+++ Makefile.in
-@@ -51,42 +51,39 @@ default: all
- install: all
- for dir in $(INSTDIRS); do \
- echo making $@ in $$dir; \
-- (cd $$dir && PATH=$(scriptdir):$(bindir):$(PATH) \
-+ (cd $$dir && PATH="$(scriptdir):$(bindir):$(PATH)" \
- $(MAKE) $@) || exit 1; \
- done
-- if test -d $(texmf) && test -f $(srcdir)/release-tetex-src.txt; then \
-- $(INSTALL_DATA) $(srcdir)/release-tetex-src.txt $(texmf); \
-- fi
- @FMU@
- @FMU@install-extra:
- # temporary fix for missing links
- test -f texk/web2c/omegafonts/omfonts && \
- cd texk/web2c/omegafonts; $(MAKE) install-links
- $(srcdir)/selfautofix "$(bindir)" "$(texmf)/web2c"
-- - if test -f $(scriptdir)/mktexlsr; then \
-- TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-+ - if false && test -f $(scriptdir)/mktexlsr; then \
-+ TEXMFMAIN=$(texmf) PATH="$(scriptdir):$(bindir):$(PATH)" \
- $(scriptdir)/mktexlsr; \
- else :; fi
-- - if test -f $(scriptdir)/fmtutil-sys; then \
-- TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-+ - if false && test -f $(scriptdir)/fmtutil-sys; then \
-+ TEXMFMAIN=$(texmf) PATH="$(scriptdir):$(bindir):$(PATH)" \
- $(scriptdir)/fmtutil-sys --all; \
- else :; fi
-- - if test -f $(scriptdir)/texlinks; then \
-- TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-+ - if false && test -f $(scriptdir)/texlinks; then \
-+ TEXMFMAIN=$(texmf) PATH="$(scriptdir):$(bindir):$(PATH)" \
- $(scriptdir)/texlinks; \
- else :; fi
-- - if test -f $(scriptdir)/updmap-sys \
-- && TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-+ - if false && test -f $(scriptdir)/updmap-sys \
-+ && TEXMFMAIN=$(texmf) PATH="$(scriptdir):$(bindir):$(PATH)" \
- $(scriptdir)/kpsewhich --format='web2c files' updmap.cfg >/dev/null; \
- then \
-- TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-+ TEXMFMAIN=$(texmf) PATH="$(scriptdir):$(bindir):$(PATH)" \
- $(scriptdir)/updmap-sys; \
- else :; fi
-
- install-exec:
- for dir in $(INSTDIRS); do \
- echo making $@ in $$dir; \
-- (cd $$dir && PATH=$(scriptdir):$(bindir):$(PATH) \
-+ (cd $$dir && PATH="$(scriptdir):$(bindir):$(PATH)" \
- $(MAKE) $@) || exit 1; \
- done
- @FMU@
-@@ -94,8 +91,8 @@ install-exec:
- # temporary fix for missing links
- test -f texk/web2c/omegafonts/omfonts && \
- cd texk/web2c/omegafonts; $(MAKE) install-links
-- - if test -f $(scriptdir)/texlinks; then \
-- TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-+ - if false && test -f $(scriptdir)/texlinks; then \
-+ TEXMFMAIN=$(texmf) PATH="$(scriptdir):$(bindir):$(PATH)" \
- $(scriptdir)/texlinks; \
- else :; fi
-
diff --git a/print/teTeX3-bin/patches/patch-ar b/print/teTeX3-bin/patches/patch-ar
deleted file mode 100644
index 1119690d052..00000000000
--- a/print/teTeX3-bin/patches/patch-ar
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-ar,v 1.3 2009/01/26 21:17:05 minskim Exp $
-
---- texk/web2c/Makefile.in.orig 2005-02-06 02:56:56.000000000 -0800
-+++ texk/web2c/Makefile.in
-@@ -600,7 +600,7 @@ tex-check: trip tex.fmt
- TEXMFCNF=../kpathsea \
- ./tex --mltex --progname=initex --ini $(srcdir)/tests/mltextst
- -./tex </dev/null
-- -PATH=`pwd`:$(kpathsea_dir):$(kpathsea_srcdir):$$PATH \
-+ -PATH="`pwd`:$(kpathsea_dir):$(kpathsea_srcdir):$$PATH" \
- WEB2C=$(kpathsea_srcdir) TMPDIR=.. \
- ./tex --progname=tex '\nonstopmode\font\foo=nonesuch\end'
- clean:: tex-clean
-@@ -986,7 +986,7 @@ install-data:: $(web2cdir)
- cd man && $(MAKE) $(install_makeargs) install-data
- $(INSTALL_DATA) $(srcdir)/tiedir/tie.1 $(man1dir)/tie.$(manext)
- $(INSTALL_DATA) $(srcdir)/ctiedir/ctie.1 $(man1dir)/ctie.$(manext)
-- $(INSTALL_DATA) fmtutil.cnf $(web2cdir)/fmtutil.cnf
-+ $(INSTALL_DATA) fmtutil.cnf $(prefix)/share/texmf/fmtutil/format.tetex.cnf
-
- # Dummy target.
- uninstall uninstall-exec uninstall-data:
diff --git a/print/teTeX3-bin/patches/patch-as b/print/teTeX3-bin/patches/patch-as
deleted file mode 100644
index 2bcb415fcf3..00000000000
--- a/print/teTeX3-bin/patches/patch-as
+++ /dev/null
@@ -1,112 +0,0 @@
-$NetBSD: patch-as,v 1.16 2015/04/27 07:36:13 markd Exp $
-
---- texk/tetex/Makefile.in.orig 2005-02-04 22:20:54.000000000 +0000
-+++ texk/tetex/Makefile.in
-@@ -7,27 +7,20 @@ ac_include ../make/programs.mk
-
- man5dir = $(mandir)/man5
-
--SCRIPTS = \
-- allcm allneeded dvi2fax dvired fmtutil fontinst \
-- kpsetool kpsewhere ps2frag pslatex rubibtex rumakeindex \
-- texconfig texconfig-dialog texdoc texdoctk texexec texlinks updmap \
-- ps4pdf fmtutil-sys texconfig-sys updmap-sys
-+SCRIPTS =
-
--PDFSCRIPTS = a2ping e2pall epstopdf
-+PDFSCRIPTS =
-
- PERLWRAPPED = fdf2tan fdf2tex makempy texfind texfont texshow texutil \
-- thumbpdf pdfcrop uniqleaf
-+ uniqleaf
-
- manpgs = \
-- allcm allec allneeded dvi2fax dvired e2pall epstopdf fdf2tex fontinst \
-- kpsetool kpsewhere makempy mkocp mkofm ofm2opl opl2ofm otp2ocp outocp \
-- ovf2ovp ovp2ovf ps2frag pslatex rubibtex rumakeindex texconfig texdoc \
-- texdoctk texexec texfind texfont texshow texutil thumbpdf \
-- ttf2afm updmap
-+ fdf2tex \
-+ texshow
-
- INFOFILES= latex.info
- POOLFILES = pdfetex-pl.pool
--all: $(SCRIPTS) $(PDFSCRIPTS)
-+all:
- default: all
-
- install: install-data install-exec
-@@ -39,73 +32,18 @@ install-data:: $(INFOFILES)
- for p in $(manpgs); do \
- $(INSTALL_DATA) $(srcdir)/$$p.man $(man1dir)/$$p.$(manext); \
- done
-- $(INSTALL_DATA) $(srcdir)/fmtutil.man $(man1dir)/fmtutil.1
-- $(INSTALL_DATA) $(srcdir)/texlinks.man $(man1dir)/texlinks.1
-- $(INSTALL_DATA) $(srcdir)/fmtutil.cnf.5 $(man5dir)/fmtutil.cnf.5
-- cd $(man1dir); rm -f allec.$(manext) texhash.$(manext) \
-- lambda.$(manext) pdflatex.$(manext) kpsepath.$(manext) \
-- kpsexpand.$(manext) mf-nowin.$(manext) ctangle.$(manext) \
-- cweave.$(manext) odvicopy.$(manext) \
-- odvitype.$(manext) texconfig-sys.$(manext) \
-- updmap-sys.$(manext) mktexfmt.$(manext) fmtutil-sys.$(manext)
-- ln -s allcm.$(manext) $(man1dir)/allec.$(manext)
-- ln -s mktexlsr.$(manext) $(man1dir)/texhash.$(manext)
-- ln -s omega.$(manext) $(man1dir)/lambda.$(manext)
-- ln -s pdfetex.$(manext) $(man1dir)/pdflatex.$(manext)
-- ln -s kpsetool.$(manext) $(man1dir)/kpsepath.$(manext)
-- ln -s kpsetool.$(manext) $(man1dir)/kpsexpand.$(manext)
-- ln -s mf.$(manext) $(man1dir)/mf-nowin.$(manext)
-- ln -s cweb.$(manext) $(man1dir)/ctangle.$(manext)
-- ln -s cweb.$(manext) $(man1dir)/cweave.$(manext)
-- ln -s dvicopy.$(manext) $(man1dir)/odvicopy.$(manext)
-- ln -s dvitype.$(manext) $(man1dir)/odvitype.$(manext)
-- ln -s texconfig.$(manext) $(man1dir)/texconfig-sys.$(manext)
-- ln -s updmap.$(manext) $(man1dir)/updmap-sys.$(manext)
-- ln -s fmtutil.$(manext) $(man1dir)/mktexfmt.$(manext)
-- ln -s fmtutil.$(manext) $(man1dir)/fmtutil-sys.$(manext)
- test -r ./latex.info || cd $(srcdir) && for i in latex.info*; do \
- $(INSTALL_DATA) $$i $(infodir)/$$i; done
- if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
- install-info --info-dir=$(infodir) $(infodir)/latex.info; \
- else true; fi
-- for p in $(POOLFILES); do \
-- $(INSTALL_DATA) $(srcdir)/$$p $(texpooldir)/$$p; \
-- done
-- for p in TETEXDOC.pdf TETEXDOC.ps TETEXDOC.dvi teTeX-FAQ; do \
-- $(INSTALL_DATA) $(srcdir)/doc/$$p $(texmf)/doc/tetex; \
-- done
-- $(SHELL) $(top_srcdir)/../mkinstalldirs $(texmf)/texconfig $(texmf)/texconfig/g $(texmf)/texconfig/v $(texmf)/texconfig/x
-- $(INSTALL_DATA) $(srcdir)/texmf/texconfig/g/generic $(texmf)/texconfig/g
-- $(INSTALL_DATA) $(srcdir)/texmf/texconfig/v/vt100 $(texmf)/texconfig/v
-- $(INSTALL_DATA) $(srcdir)/texmf/texconfig/x/xterm $(texmf)/texconfig/x
-- $(INSTALL_DATA) $(srcdir)/texmf/texconfig/README $(texmf)/texconfig
-- $(INSTALL_DATA) $(srcdir)/texmf/texconfig/generic $(texmf)/texconfig
-- $(INSTALL_SCRIPT) $(srcdir)/tcfmgr $(texmf)/texconfig/tcfmgr
-- $(INSTALL_DATA) $(srcdir)/tcfmgr.map $(texmf)/texconfig/tcfmgr.map
-
- install-exec:
- -$(SHELL) $(srcdir)/../mkinstalldirs $(scriptdir)
-- for s in $(SCRIPTS); do \
-- $(INSTALL_SCRIPT) $(srcdir)/$$s $(scriptdir)/$$s; \
-- done
-- if test -f $(bindir)/pdfetex; then \
-- for s in $(PDFSCRIPTS); do \
-- $(INSTALL_SCRIPT) $(srcdir)/$$s $(scriptdir)/$$s; \
-- done; \
-- cd $(scriptdir); rm -f mptopdf; ln -s texexec mptopdf; \
-- else \
-- true; \
-- fi
-- cd $(scriptdir); rm -f allec kpsepath kpsexpand texhash; \
-- ln -s allcm allec; \
-- ln -s kpsetool kpsepath; \
-- ln -s kpsetool kpsexpand; \
-- ln -s mktexlsr texhash
- cd $(scriptdir); rm -f $(PERLWRAPPED); \
- for f in $(PERLWRAPPED); do \
- ln -s texexec $$f; \
- done
-- cd $(scriptdir); rm -f mktexfmt; ln -s fmtutil mktexfmt
-
- ac_include ../make/clean.mk
-
diff --git a/print/teTeX3-bin/patches/patch-at b/print/teTeX3-bin/patches/patch-at
deleted file mode 100644
index 65fccb848e5..00000000000
--- a/print/teTeX3-bin/patches/patch-at
+++ /dev/null
@@ -1,1893 +0,0 @@
-$NetBSD: patch-at,v 1.3 2008/05/25 17:10:29 tonnerre Exp $
-
---- texk/dviljk/dvi2xx.c
-+++ texk/dviljk/dvi2xx.c
-@@ -2,1 +2,1 @@
--#define VERSION "2.6p2 (dviljk)"
-+#define VERSION "dviljk (version 2.6p3)"
-@@ -165,7 +165,7 @@ char *argv[];
- # endif
- #endif
-
-- /* Initialize pixel_files */
-+ /* Initialize pixel_files */
- for (i = 0; i <= MAXOPEN; i++)
- pixel_files[i].pixel_file_id = FPNULL;
-
-@@ -173,7 +173,7 @@ char *argv[];
- y_origin = YDEFAULTOFF; /* y-origin in dots */
-
- setbuf(ERR_STREAM, NULL);
-- (void) strcpy(G_progname, argv[0]);
-+ G_progname = argv[0];
- #ifdef KPATHSEA
- kpse_set_progname(argv[0]);
- kpse_set_program_enabled (kpse_pk_format, MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile);
-@@ -275,7 +275,7 @@ char *argv[];
- EMIT1("@PJL SET PAGEPROTECT=OFF\012");
- EMIT1("@PJL ENTER LANGUAGE=PCL\012");
- if (econoMode && LJ6)
-- EMIT1("@PJL SET ECONOMODE=ON\012");
-+ EMIT1("@PJL SET ECONOMODE=ON\012");
- EMIT3("\033&u%dD\033*t%dR",RESOLUTION,RESOLUTION);
- if (econoMode && !LJ6)
- EMIT1("\033*v1T");
-@@ -431,8 +431,8 @@ char *argv[];
- /*
- fprintf(ERR_STREAM,"FirstPart\n count %d, mod %d, pp %d\n",(int)count[0],(int)count[0]%2,PageParity);
- */
-- SkipMode =
-- (bool)(PageParity != (short)((count[0]<0 ?
-+ SkipMode =
-+ (bool)(PageParity != (short)((count[0]<0 ?
- labs(count[0])+1 : count[0])%2));
- if (count[0] == 0) SkipMode = (bool)!SkipMode;
- }
-@@ -641,7 +641,7 @@ char *argv[];
- is not buffered. */
-
- /* read a buffered byte */
--char
-+char
- #if NeedFunctionPrototypes
- b_read(FILEPTR spfp)
- #else
-@@ -661,7 +661,7 @@ FILEPTR spfp;
- }
-
- #ifdef RISC_BUFFER
--void
-+void
- #if NeedFunctionPrototypes
- b_write(FILEPTR spfp, char c) /* write a buffered byte */
- #else
-@@ -677,7 +677,7 @@ char c;
- buffout[boact++] = c;
- }
-
--void
-+void
- #if NeedFunctionPrototypes
- b_wrtmult(FILEPTR spfp, char *buf, int len) /* write a sequence of bytes to the output buffer */
- #else
-@@ -693,22 +693,22 @@ int len;
- write_multi(buffout,1,boact,spfp);
- /* Copy only small blocks; large ones are written directly */
- if (len < (BUFFSIZE/4)) {
-- for (i = 0; i<len; i++)
-+ for (i = 0; i<len; i++)
- buffout[i] = buf[i];
- boact = len;
- } else {
-- write_multi(buf,1,len,spfp);
-+ write_multi(buf,1,len,spfp);
- boact = 0;
- }
- }
- else {
-- for (i = 0; i<len; i++)
-+ for (i = 0; i<len; i++)
- buffout[boact++] = buf[i];
- }
- }
-
- /* flush the output buffer */
--void
-+void
- #if NeedFunctionPrototypes
- b_oflush(FILEPTR spfp)
- #else
-@@ -762,9 +762,9 @@ char *str;
- /***************************** CopyHPFile ******************************/
- /*********************************************************************/
- #if NeedFunctionPrototypes
--int getnum(FILEPTR spfp, char *t, char *numstr)
-+int getnum(FILEPTR spfp, char *t, char *numstr)
- #else
--int getnum(spfp, t, numstr)
-+int getnum(spfp, t, numstr)
- FILEPTR spfp;
- char *t, *numstr;
- #endif
-@@ -777,30 +777,30 @@ char *t, *numstr;
- }
-
- #if NeedFunctionPrototypes
--void setOffset(char dir, char sign, int pos)
-+void setOffset(char dir, char sign, int pos)
- #else
--void setOffset(dir, sign, pos, first)
-+void setOffset(dir, sign, pos, first)
- char dir, sign;
- int pos;
- #endif
- {
- if ((sign == '+' || sign == '-') && pos > 0 ) {
- EMIT4("\033*p%c%d%c",sign,pos,dir);
--#ifdef DEBUGGS
-+#ifdef DEBUGGS
- fprintf(stderr, "relative: *p%c%d%c\n", sign, pos, dir);
- #endif
- } else if (pos>0) {
- EMIT3("\033*p%d%c",pos,dir);
--#ifdef DEBUGGS
-+#ifdef DEBUGGS
- fprintf(stderr, "absolute: *p%d%c\n", pos, dir);
- #endif
-- if (dir == 'X')
-+ if (dir == 'X')
- last_rx = pos;
-- else
-+ else
- last_ry = pos;
- } else {
- /*EMIT3("\033*p%d%c",pos,dir);*/
--#ifdef DEBUGGS
-+#ifdef DEBUGGS
- fprintf(stderr, "Relative: *p%d%c\n", pos, dir);
- #endif
- }
-@@ -832,7 +832,7 @@ char *str;
- unwanted commands from the input file and outputs the rest */
-
- /* reset the input buffer */
-- binumber = 0;
-+ binumber = 0;
- biact = 0;
-
- qfprintf(ERR_STREAM," [%s", str);
-@@ -853,16 +853,16 @@ char *str;
- /* of the commands (x first, y first) */
-
- if (t=='Y' || t=='y') {
-- if (numstr[0]!='+' && numstr[0]!='-' && num<miny)
-+ if (numstr[0]!='+' && numstr[0]!='-' && num<miny)
- miny = num;
- if (t=='y') {
- num = getnum(spfp, &t, numstr);
-- if (numstr[0]!='+' && numstr[0]!='-' && num<minx)
-+ if (numstr[0]!='+' && numstr[0]!='-' && num<minx)
- minx = num;
- }
- }
- if (t=='X' || t=='x') {
-- if (numstr[0]!='+' && numstr[0]!='-' && num<minx)
-+ if (numstr[0]!='+' && numstr[0]!='-' && num<minx)
- minx = num;
-
- if (t=='x') {
-@@ -920,16 +920,16 @@ char *str;
- }
- qfprintf(ERR_STREAM," [%s", str);
- /* reset input buffer again */
-- binumber = 0;
-+ binumber = 0;
- biact = 0;
-
-
- /* Pass through the input file again but this time output the */
- /* retained PCL commands */
--#ifdef DEBUGGS
-- fprintf(stderr,"\nminx=%d, miny=%d, xg=%d, yg=%d\n",
-+#ifdef DEBUGGS
-+ fprintf(stderr,"\nminx=%d, miny=%d, xg=%d, yg=%d\n",
- minx, miny, x_goffset, y_goffset);
--#endif
-+#endif
- do {
- t = (char)b_read(spfp);
- if (t==0x1B) {
-@@ -948,7 +948,7 @@ char *str;
- } else {
- setOffset('Y',numstr[0], num);
- }
--
-+
- if (t == 'y') {
- num = getnum(spfp, &t,numstr);
- if (numstr[0]!='+' && numstr[0]!='-') {
-@@ -960,16 +960,16 @@ char *str;
- }
- }
- }
--
-+
- if (t=='X' || t=='x') {
- if (numstr[0]!='+' && numstr[0]!='-') {
- /*Add in the correct horizontal offset*/
- setOffset('X',numstr[0],
- num - minx + (int)PIXROUND(h,hconv) + x_goffset);
-- } else {
-+ } else {
- setOffset('X',numstr[0], num);
- }
--
-+
- if (t=='x') {
- num = getnum(spfp, &t,numstr);
- if (numstr[0]!='+' && numstr[0]!='-') {
-@@ -1027,7 +1027,7 @@ char *str;
- case(0x63):
- /* Rectangular draw commands */
- EMIT1("\033*c");
-- for (t = (char)b_read(spfp); t<0x40 || t>0x60;
-+ for (t = (char)b_read(spfp); t<0x40 || t>0x60;
- t = (char)b_read(spfp))
- EMITC(t);
- EMITC(t);
-@@ -1110,7 +1110,7 @@ register int n; /* number of byt
- long4 x = 0; /* number being constructed */
- unsigned char h;
- while (n--) {
-- x <<= 8;
-+ x <<= 8;
- read_byte(fp,h);
- x |= h;
- }
-@@ -1143,7 +1143,7 @@ register int n; /* number of bytes
- #ifdef SIGN_DEBUG
- long4 x0; /* copy of x */
- #endif
-- read_byte(fp,h);
-+ read_byte(fp,h);
- x = h; /* get first (high-order) byte */
- n1 = n--;
- while (n--) {
-@@ -1296,7 +1296,7 @@ FILEPTR f;
- /* ---> result in DX */
-
- if ( (regs.h.dl & 0x80) /* file handle points to a device */
-- && !(regs.h.dl & 0x07) ) { /* neither console i/o or null */
-+ && !(regs.h.dl & 0x07) ) { /* neither console i/o or null */
-
- regs.h.dl |= 0x20; /* set BINARY bit in device info */
- regs.h.ah = (unsigned char) 0x44; /* IOCTL */
-@@ -1501,20 +1501,20 @@ printf("Emit character %c(%d) id=%d, yof
- /* For COMPRESSED CHARS */
- if (PrevSize < nbpl) {
- PrevSize = nbpl;
-- if (PrevLine != NULL)
-+ if (PrevLine != NULL)
- free(PrevLine);
-- if ((PrevLine = (unsigned char*)malloc(PrevSize*sizeof(char)))
-+ if ((PrevLine = (unsigned char*)malloc(PrevSize*sizeof(char)))
- == NULL) {
-- PrevSize = 0;
-+ PrevSize = 0;
- Fatal("EmitChar: Out of memory error!\n");
- }
- }
- /* Clear seed line */
-- for (i = 0; i<nbpl; i++)
-+ for (i = 0; i<nbpl; i++)
- PrevLine[i] = 0;
-- CChar_Off = 0;
-+ CChar_Off = 0;
- CChar_Last = -1;
--
-+
- /* This bit copied from below... */
- # ifdef USEPXL
- if (fontptr->id == pk89)
-@@ -1530,11 +1530,11 @@ printf("Emit character %c(%d) id=%d, yof
- CompressedCharLine(ce,nbpl,sl);
- }
- # else
-- for (i = num_rows; i > 0; i--)
-+ for (i = num_rows; i > 0; i--)
- CompressedCharLine(ce,nbpl,(bits + (i-1)*nbpl));
- # endif /* USEPXL */
- }
-- else
-+ else
- CChar_Off = -1;
- # endif /* LJ4 */
-
-@@ -1544,10 +1544,10 @@ printf("Emit character %c(%d) id=%d, yof
- # ifdef LJ4
- /* printf("raw: %d (%d * %d), comp: %d\n",
- total,ce->width,ce->height,CChar_Off); */
-- /* Characters that don't compress well are usually rather small so
-- reading them again and writing them uncompressed won't take
-+ /* Characters that don't compress well are usually rather small so
-+ reading them again and writing them uncompressed won't take
- much time anyway. */
-- if (CChar_Off > total)
-+ if (CChar_Off > total)
- CChar_Off = -1;
- if (CChar_Off >= 0) {
- EMIT4("\033*c%sd%dE\033(s%ldW", cnv_buffer,
-@@ -1606,7 +1606,7 @@ printf("Emit character %c(%d) id=%d, yof
- }
- #endif
- }
--
-+
- #ifdef IBM3812
- #ifdef USEPXL
- used_fontstorage += (long4)ce->height * ((ce->width + 15) >> 4) * 2 + 14;
-@@ -1652,7 +1652,7 @@ unsigned char *pkloc;
- int repeatcount;
-
- void /* <Read and translate raster description@>*/
--#if NeedFunctionPrototypes
-+#if NeedFunctionPrototypes
- PkRaster(struct char_entry *ce, int raster)
- #else
- PkRaster(ce, raster)
-@@ -1735,7 +1735,7 @@ int raster;
- if (wordweight < 31) {
- #ifdef COMMENT
- # ifdef DRAWGLYPH
-- {
-+ {
- int k;
- for (k = 15; k>=0; k--) {
- if ((power[k] & word)!=0) printf("Z");
-@@ -1749,7 +1749,7 @@ int raster;
- for (j = 3; j >= (wordwidth * 4 - (long4)nbpl); j--) {
- OUTCHAR(((word >> (j << 3)) & 0xff));
- #ifdef DRAWGLYPH
-- {
-+ {
- int k;
- for (k = 7; k>=0; k--) {
- if ((power[k] & ((word >> (j << 3)) & 0xff))!=0) printf("M");
-@@ -1760,9 +1760,9 @@ int raster;
- }
-
- }
--
-+
- switch (raster) {
-- case 1:
-+ case 1:
- RasterLine(ce, nbpl, current_line, raster_line_buf);
- current_line++;
- break;
-@@ -1826,7 +1826,7 @@ int raster;
- OUTCHAR((tl & 0xFF));
-
- #ifdef DRAWGLYPH
-- {
-+ {
- int k;
- for (k = 31; k>=0; k--) {
- if ((power[k] & row[ii])!=0) printf("M");
-@@ -1839,7 +1839,7 @@ int raster;
- for (j = 3; j >= (wordwidth *4 - (long4)nbpl); j--) {
- OUTCHAR(((tl >> (j << 3)) & 0xff));
- #ifdef DRAWGLYPH
-- {
-+ {
- int k;
- for (k = 7; k>=0; k--) {
- if ((power[k] & ((tl >> (j << 3)) & 0xff))!=0) printf("M");
-@@ -1850,7 +1850,7 @@ int raster;
- }
-
- switch (raster) {
-- case 1:
-+ case 1:
- RasterLine(ce, (unsigned int)nbpl, current_line, raster_line_buf);
- current_line++;
- break;
-@@ -1969,7 +1969,7 @@ int n;
-
- #ifdef LJ4
- /* Compress a raster line in compression mode 2 */
--int
-+int
- #if NeedFunctionPrototypes
- CompressLine2(unsigned char *buffer, unsigned char *buffout, int emitbytes)
- #else
-@@ -1984,13 +1984,13 @@ int emitbytes;
- char last,c;
-
- /* trap empty lines (otherwise problems with Packbits) */
-- if (emitbytes == 0)
-+ if (emitbytes == 0)
- return(0);
- /* Use Packbits compression (mode 2) on raster line */
-- pos = buffer;
-- litpos = buffer;
-- pack = 1;
-- ppos = buffout;
-+ pos = buffer;
-+ litpos = buffer;
-+ pack = 1;
-+ ppos = buffout;
- last = *pos++;
- upper = buffer + emitbytes;
- while (pos < upper) {
-@@ -2000,14 +2000,14 @@ int emitbytes;
- /* At least three equal bytes ==> write out preceding literal sequence */
- if ((pack == 3) && ((lit = (int)(pos - litpos - 3)) != 0)) {
- while (lit >= 128) {
-- *ppos++ = 127;
-- for (i = 1; i<=128; i++)
-+ *ppos++ = 127;
-+ for (i = 1; i<=128; i++)
- *ppos++ = *litpos++;
- lit -= 128;
- }
- if (lit != 0) {
-- *ppos++ = lit-1;
-- while ((lit--) > 0)
-+ *ppos++ = lit-1;
-+ while ((lit--) > 0)
- *ppos++ = *litpos++;
- /* litpos is now pos-3 (i.e. first of the sequence) */
- }
-@@ -2015,19 +2015,19 @@ int emitbytes;
- }
- else {
- while (pack >= 128) {
-- *ppos++ = 129;
-- *ppos++ = last;
-- litpos += 128;
-+ *ppos++ = 129;
-+ *ppos++ = last;
-+ litpos += 128;
- pack -= 128;
- }
- /* At least 3 equal bytes or 2 that don't break a literal sequence
- ==> write out packed sequence */
- if ((pack >= 3) || ((pack == 2) && (litpos == pos-3))) {
-- *ppos++ = 257 - pack;
-- *ppos++ = last;
-+ *ppos++ = 257 - pack;
-+ *ppos++ = last;
- litpos += pack;
- }
-- pack = 1;
-+ pack = 1;
- last = c;
- }
- if (ppos > (buffout + BUFFSIZE/2 - 129)) {
-@@ -2036,28 +2036,28 @@ int emitbytes;
- return(0);
- }
- }
--
-+
- while (pack >= 128) {
-- *ppos++ = 129;
-- *ppos++ = last;
-- litpos += 128;
-+ *ppos++ = 129;
-+ *ppos++ = last;
-+ litpos += 128;
- pack -= 128;
- }
- if ((pack >= 3) || ((pack == 2) && (litpos == pos-3))) {
-- *ppos++ = 257 - pack;
-- *ppos++ = last;
-+ *ppos++ = 257 - pack;
-+ *ppos++ = last;
- litpos += pack;
- }
- else if ((lit = (int)(pos - litpos)) != 0) {
- while (lit >= 128) {
-- *ppos++ = 127;
-- for (i = 1; i<=128; i++)
-+ *ppos++ = 127;
-+ for (i = 1; i<=128; i++)
- *ppos++ = *litpos++;
- lit -= 128;
- }
- if (lit != 0) {
-- *ppos++ = lit-1;
-- while ((lit--) > 0)
-+ *ppos++ = lit-1;
-+ while ((lit--) > 0)
- *ppos++ = *litpos++;
- }
- }
-@@ -2079,24 +2079,24 @@ int emitbytes;
- int lit,i,pack;
-
- /* Use compression mode 3 */
-- pos = buffer;
-- ppos = buffout;
-- upper = buffer + emitbytes;
-+ pos = buffer;
-+ ppos = buffout;
-+ upper = buffer + emitbytes;
- prev = PrevLine;
- while(pos < upper) {
- litpos = pos;
- while ((*prev == *pos) && (pos < upper)) {
-- prev++;
-+ prev++;
- pos++;
- }
- if (pos < upper) {
-- pack = (int)(pos - litpos);
-+ pack = (int)(pos - litpos);
- litpos = pos;
-- i = upper - pos;
-- if (i > 8)
-+ i = upper - pos;
-+ if (i > 8)
- i = 8;
- while ((*pos != *prev) && (i > 0)) {
-- *prev++ = *pos++;
-+ *prev++ = *pos++;
- i--;
- }
- i = (int)(pos - litpos - 1);
-@@ -2105,16 +2105,16 @@ int emitbytes;
- *ppos++ = lit + pack;
- }
- else {
-- *ppos++ = lit + 31;
-+ *ppos++ = lit + 31;
- pack -= 31;
- while (pack >= 255) {
-- *ppos++ = 255;
-+ *ppos++ = 255;
- pack -= 255;
- }
- *ppos++ = pack;
- }
- while (i >= 0) {
-- *ppos++ = *litpos++;
-+ *ppos++ = *litpos++;
- i--;
- }
- }
-@@ -2134,7 +2134,7 @@ int emitbytes;
- /**********************************************************************/
- void
- #if NeedFunctionPrototypes
--RasterLine(struct char_entry *ce, unsigned int nbpl,
-+RasterLine(struct char_entry *ce, unsigned int nbpl,
- unsigned int current_line, unsigned char *buffer)
- #else
- RasterLine(ce, nbpl, current_line, buffer)
-@@ -2208,21 +2208,21 @@ char *buffer;
- EMIT2("\033*b%dW", emitbytes);
- EMITL(emitbytes, buffer);
- break;
--
-+
- case 2:
- i = CompressLine2(buffer,buffin,emitbytes);
- EMIT2("\033*b%dW", i);
- EMITL(i,buffin);
- break;
--
-+
- case 3:
- i = CompressLine3(buffer,buffin + BUFFSIZE/2,(int)nbpl);
- EMIT2("\033*b%dW", i);
- EMITL(i,buffin + BUFFSIZE/2);
- break;
--
-- default:
-- fprintf(ERR_STREAM,"Unsupported compression mode!\n");
-+
-+ default:
-+ fprintf(ERR_STREAM,"Unsupported compression mode!\n");
- }
- # else
- EMIT2("\033*b%dW", emitbytes);
-@@ -2280,10 +2280,10 @@ struct char_entry *ce;
- if (CompressCharMode == 3) {
- /* Check if PrevLine big enough; claim more space if not */
- if (((int)nbpl) > PrevSize) {
-- if (PrevLine != NULL)
-+ if (PrevLine != NULL)
- free(PrevLine);
- if ((PrevLine = (unsigned char *)malloc(nbpl*sizeof(char))) == NULL) {
-- PrevSize = 0;
-+ PrevSize = 0;
- Fatal("RasterChar: out of memory!\n");
- }
- PrevSize = (int)nbpl;
-@@ -2419,7 +2419,7 @@ register struct char_entry *ptr;
- if (bytes > 0) {
- /* do NOT load Huge characters */
- if ((bytes > HUGE_CHAR_PATTERN) && (fontptr->id != pk89)) {
-- qfprintf(ERR_STREAM,"Huge Character <%c> (%ld Bytes)\n",
-+ qfprintf(ERR_STREAM,"Huge Character <%c> (%ld Bytes)\n",
- (char)c, bytes);
- ptr->charsize = HUGE_SIZE;
- ptr->where.isloaded = _FALSE;
-@@ -2505,7 +2505,7 @@ bool do_posn,in_string;
- SetPosn(h, v);
- }
-
-- /*
-+ /*
- fprintf(ERR_STREAM,
- "(%d) hh=%ld (+%ld/+%ld), h=%ld, xh=%ld,xhh=%ld, [%ld|%ld] ->%d\n",
- (int)do_posn,hh,(long4)ptr->cw,(long4)ptr->cw*(long4)hconv,h,
-@@ -2553,7 +2553,7 @@ bool do_posn,in_string;
- int tmp;
- char sign;
-
-- if (!do_posn)
-+ if (!do_posn)
- SetPosn(h, v);
-
- #ifdef USEPXL
-@@ -2563,7 +2563,7 @@ bool do_posn,in_string;
- #endif
- if (tmp != 0) {
- if (tmp < 0) {
-- sign = '-';
-+ sign = '-';
- tmp = -tmp;
- } else
- sign = '+';
-@@ -2576,7 +2576,7 @@ bool do_posn,in_string;
- #endif
- if (tmp != 0) {
- if (tmp < 0) {
-- sign = '-';
-+ sign = '-';
- tmp = -tmp;
- } else
- sign = '+';
-@@ -2644,7 +2644,7 @@ bool do_posn,in_string;
- fprintf(stderr,"--> hh(%ld) += cw(%ld) * hconv(%ld)",
- (long)hh, (long)ptr->cw, (long) hconv);
- */
--#ifdef LJ
-+#ifdef LJ
- /* the guessed position must be a multiple of pixels */
- if (RESOLUTION == 300)
- hh += (long4) ((ptr->cw)/4)*4*hconv;
-@@ -2661,7 +2661,7 @@ bool do_posn,in_string;
- if (command <= SET4)
- h += ptr->tfmw;
-
-- if (pos_after)
-+ if (pos_after)
- SetPosn(h, v);
- else
- last_rx = (int)PIXROUND(h, hconv) + x_goffset;
-@@ -2682,7 +2682,7 @@ void DoBop()
- }
- fonts_used_on_this_page = 0;
- #endif
-- for (p = hfontptr; p; p = p->next)
-+ for (p = hfontptr; p; p = p->next)
- p->used_on_this_page = _FALSE;
- }
-
-@@ -2740,7 +2740,7 @@ long4 x, y;
- rx = (int)PIXROUND(x, hconv) + x_goffset;
- ry = (int)PIXROUND(y, vconv) + y_goffset;
-
-- /*
-+ /*
- fprintf(ERR_STREAM,
- "setposn to %ld/%ld, %d/%d, last: %d/%d\n",
- (long)x,(long)y,
-@@ -2804,13 +2804,13 @@ long4 x, y;
- offset in the buffer, CChar_Last is the first byte of the last
- compacted row (line repeat count). Updates the previous line
- (PrevLine) if necessary. */
--void
-+void
- #if NeedFunctionPrototypes
- CompressedCharLine(struct char_entry *ce, int nbpl, unsigned char *buffer)
- #else
- CompressedCharLine(ce, nbpl, buffer)
- struct char_entry *ce;
--int nbpl;
-+int nbpl;
- unsigned char *buffer;
- #endif
- {
-@@ -2821,31 +2821,31 @@ unsigned char *buffer;
- int t,mode,max;
- register int x,y,i;
-
-- prev = PrevLine;
-- obuf = buffer;
-- end = buffer + nbpl;
-+ prev = PrevLine;
-+ obuf = buffer;
-+ end = buffer + nbpl;
- x = 0;
- while (obuf < end) {
- if (*obuf != *prev) {
-- *prev = *obuf;
-+ *prev = *obuf;
- x = 1;
- }
-- obuf++;
-+ obuf++;
- prev++;
- }
- if (x == 0 && CChar_Last >= 0) {
-- (buffin[CChar_Last])++;
-+ (buffin[CChar_Last])++;
- return; /* line repeat count +1 */
- }
-
-- end = buffin + BUFFSIZE - 16;
-- obuf = buffin + CChar_Off;
-+ end = buffin + BUFFSIZE - 16;
-+ obuf = buffin + CChar_Off;
- buff = buffer;
- *obuf++ = 0; /* Line repeat count = 0 */
- t = 0;
- CChar_Last = CChar_Off; /* Next line */
-- mode = 0;
-- y = *buff++;
-+ mode = 0;
-+ y = *buff++;
- i = 7; /* i = current bit */
- while ((t < ce->width) && (obuf < end)) {
- max = ce->width - t; /* maximum pixels left to do */
-@@ -2853,13 +2853,13 @@ unsigned char *buffer;
- if (mode == 0) {
- /* white run */
- while ((y & (1<<i)) == 0 && x < max) {
-- x++;
-- i--;
-+ x++;
-+ i--;
- if (i < 0) {
-- i = 7;
-- y = *buff++;
-+ i = 7;
-+ y = *buff++;
- while (y == 0 && x < max) {
-- x += 8;
-+ x += 8;
- y = *buff++;
- }
- }
-@@ -2869,26 +2869,26 @@ unsigned char *buffer;
- else {
- /* black run */
- while ((y & (1<<i)) != 0 && x < max) {
-- x++;
-- i--;
-+ x++;
-+ i--;
- if (i < 0) {
-- i = 7;
-- y = *buff++;
-+ i = 7;
-+ y = *buff++;
- while (y == 0xff && x < max) {
-- x += 8;
-+ x += 8;
- y = *buff++;
- }
- }
- }
- mode = 0;
- }
-- if (x > max)
-+ if (x > max)
- x = max;
- t += x;
- /* make precautions for very long runs */
- while (x > 0xff) {
-- *obuf++ = 0xff;
-- *obuf++ = 0;
-+ *obuf++ = 0xff;
-+ *obuf++ = 0;
- x -= 0xff;
- }
- *obuf++ = x;
-@@ -2968,8 +2968,8 @@ char *argv[];
- #endif
- {
- int argind; /* argument index for flags */
-- char curarea[STRSIZE]; /* current file area */
-- char curname[STRSIZE]; /* current file name */
-+ char *curarea; /* current file area */
-+ char *curname; /* current file name */
- char *tcp, *tcp1; /* temporary character pointers */
- char *this_arg;
- double x_offset = 0.0, y_offset = 0.0;
-@@ -2988,9 +2988,9 @@ char *argv[];
- #endif
- #endif
-
-- if (argc == 2 && (strcmp (argv[1], "--version") == 0)) {
-+ if (argc == 2 && EQ(argv[1], "--version")) {
- extern KPSEDLL char *kpathsea_version_string;
-- puts ("dvilj(k) 2.6");
-+ puts (VERSION);
- puts (kpathsea_version_string);
- puts ("Copyright (C) 1997 Gustaf Neumann.\n\
- There is NO warranty. You may redistribute this software\n\
-@@ -2998,7 +2998,7 @@ under the terms of the GNU General Publi
- For more information about these matters, see the files\n\
- named COPYING and dvi2xx.c.\n\
- Primary author of Dvi2xx: Gustaf Neumann; -k maintainer: K. Berry.");
-- exit (0);
-+ exit (0);
- }
-
- #ifdef LJ4
-@@ -3048,9 +3048,9 @@ Primary author of Dvi2xx: Gustaf Neumann
- #ifdef LJ2P
- case 'd': /* d selects DUPLEX mode */
- tcp++;
-- if (*tcp == '1' )
-+ if (*tcp == '1' )
- DuplexMode = 1;
-- else if (*tcp == '2')
-+ else if (*tcp == '2')
- DuplexMode = 2;
- else {
- Warning("Invalid DUPLEX mode, assuming DUPLEX=1, Long-Edge Binding");
-@@ -3062,13 +3062,13 @@ Primary author of Dvi2xx: Gustaf Neumann
- DoublePage = _TRUE;
- tcp++;
- if (*tcp == '1' || *tcp == '2') {
-- if (*tcp == '2')
-+ if (*tcp == '2')
- PrintFirstPart = _FALSE;
-- else
-+ else
- PrintSecondPart = _FALSE;
- tcp++;
- }
-- if (*tcp == '-')
-+ if (*tcp == '-')
- PrintEmptyPages = _FALSE;
- break;
- #ifdef LJ4
-@@ -3256,14 +3256,14 @@ Primary author of Dvi2xx: Gustaf Neumann
- #ifdef LJ
- case 'V': /* bugfixes for various vendor's PCL emulations */
- tcp++;
-- if (*tcp == 'K' || *tcp == 'k')
-+ if (*tcp == 'K' || *tcp == 'k')
- kyocera_mode = _TRUE;
- else
-- if (*tcp == 'B' || *tcp == 'b')
-+ if (*tcp == 'B' || *tcp == 'b')
- brother_mode = _TRUE;
- # ifdef LJ4
- else
-- if (*tcp == '6' || *tcp == '6')
-+ if (*tcp == '6' || *tcp == '6')
- LJ6 = _TRUE;
- # endif
- break;
-@@ -3306,7 +3306,7 @@ Primary author of Dvi2xx: Gustaf Neumann
- #endif
- #ifdef __riscos
- case 'i': /* name of directory to store diagrams in */
-- tcp++;
-+ tcp++;
- ddi = 0;
- while (*tcp != ' ' && *tcp != '\0' && ddi < DIAGDIRSIZE-1) {
- diagdir[ddi++] = *tcp++;
-@@ -3328,8 +3328,8 @@ Primary author of Dvi2xx: Gustaf Neumann
- }
- } else {
-
-- (void) strcpy(filename, tcp);
-- if (!strcmp(filename, "-")) {
-+ filename = tcp;
-+ if (EQ(filename, "-")) {
- EmitFileName = "-";
- #ifdef RISC_USE_OSL
- dvifp = BINOPEN("Kbd:");
-@@ -3339,57 +3339,68 @@ Primary author of Dvi2xx: Gustaf Neumann
- AssureBinary(fileno(dvifp));
- #endif
- } else {
-+ /* Since this code is used only once during startup, we don't care
-+ about free()ing the allocated strings that represent filenames.
-+ It will be more work to realize proper deallocation handling than
-+ it's worth in terms of saving a few bytes. We consider these
-+ bytes actually static memory where we don't know the size in
-+ advance and don't add them to the allocated_storage count.
-+ [27 Jun 07 -js] */
- #ifdef KPATHSEA
- /* split into directory + file name */
- int tcplen, argvlen;
- tcp = (char *)xbasename(argv[argind]);/* this knows about any kind of slashes */
- tcplen = strlen(tcp);
-+ if ( tcplen == 0 ) {
-+ /* This happens when the DVI file name has a trailing slash; this
-+ is not a valid name. Then we terminate the argument parsing
-+ loop, a usage message will be output below. */
-+ break;
-+ }
- argvlen = strlen(argv[argind]);
- if (tcplen == argvlen)
-- curarea[0] = '\0';
-+ curarea = "";
- else {
-- (void) strcpy(curarea, argv[argind]);
-+ curarea = xstrdup(argv[argind]);
- curarea[argvlen-tcplen] = '\0';
- }
- #else
- tcp = strrchr(argv[argind], '/');
- /* split into directory + file name */
- if (tcp == NULL) {
-- curarea[0] = '\0';
-+ curarea[0] = "";
- tcp = argv[argind];
- } else {
-- (void) strcpy(curarea, argv[argind]);
-+ curarea = xstrdup(argv[argind]);
- curarea[tcp-argv[argind]+1] = '\0';
- tcp += 1;
- }
- #endif
-
-- (void) strcpy(curname, tcp);
-+ curname = (char *) xmalloc(strlen(tcp)+5); /* + space for ".dvi" */
-+ (void) strcpy(curname, tcp);
- /* split into file name + extension */
-- tcp1 = strrchr(tcp, '.');
-+ tcp1 = strrchr(curname, '.');
- if (tcp1 == NULL) {
-- (void) strcpy(rootname, curname);
-+ rootname = xstrdup(curname);
- strcat(curname, ".dvi");
- } else {
- *tcp1 = '\0';
-- (void) strcpy(rootname, curname);
-+ rootname = xstrdup(curname);
- *tcp1 = '.';
- }
-
-+ filename = (char *) xmalloc(strlen(curarea)+strlen(curname)+1);
- (void) strcpy(filename, curarea);
- (void) strcat(filename, curname);
-
- if ((dvifp = BINOPEN(filename)) == FPNULL) {
- /* do not insist on .dvi */
- if (tcp1 == NULL) {
-- int l = strlen(curname);
-- if (l > 4)
-- curname[l - 4] = '\0';
-- l = strlen(filename);
-- if (l > 4)
-- filename[l - 4] = '\0';
-+ filename[strlen(filename) - 4] = '\0';
-+ dvifp = BINOPEN(filename);
- }
-- if (tcp1 != NULL || (dvifp = BINOPEN(filename)) == FPNULL) {
-+ if (dvifp == FPNULL) {
- #ifdef MSC5
- Fatal("%s: can't find DVI file \"%s\"\n\n",
- G_progname, filename);
-@@ -3411,7 +3422,7 @@ Primary author of Dvi2xx: Gustaf Neumann
- y_goffset = (short) MM_TO_PXL(y_offset) + y_origin;
-
- if (dvifp == FPNULL) {
-- fprintf(ERR_STREAM,"\nThis is the DVI to %s converter version %s",
-+ fprintf(ERR_STREAM,"\nThis is the DVI to %s converter %s",
- PRINTER, VERSION);
- #ifdef SEVENBIT
- fprintf(ERR_STREAM,", 7bit");
-@@ -3507,13 +3518,8 @@ Primary author of Dvi2xx: Gustaf Neumann
- exit(1);
- }
- if (EQ(EmitFileName, "")) {
-- if ((EmitFileName = (char *)malloc( STRSIZE )) != NULL)
-- allocated_storage += STRSIZE;
-- else
-- Fatal("Can't allocate storage of %d bytes\n",STRSIZE);
-- (void) strcpy(EmitFileName, curname);
-- if ((tcp1 = strrchr(EmitFileName, '.')))
-- *tcp1 = '\0';
-+ EmitFileName = (char *) xmalloc(strlen(rootname)+sizeof(EMITFILE_EXTENSION));
-+ (void) strcpy(EmitFileName, rootname);
- strcat(EmitFileName, EMITFILE_EXTENSION);
- }
- if (G_quiet)
-@@ -3668,7 +3674,7 @@ bool PFlag;
- if (PrintTestPage) EMIT1("\033z");
- #ifdef vms
- /* last record is not flushed to file, unless it is completely filled */
-- for (kk = (int)((*outfp)->_cnt); kk > 0; --kk)
-+ for (kk = (int)((*outfp)->_cnt); kk > 0; --kk)
- putc('\0',outfp);
- fflush(outfp);
- #endif
-@@ -3698,6 +3704,8 @@ bool PFlag;
- #endif
- }
- CloseFiles();
-+ if ( tmp_dir[0] != '\0' )
-+ rmdir (tmp_dir); /* ignore errors */
- exit(G_errenc);
- }
-
-@@ -3764,15 +3772,15 @@ char **end;
- #endif
- {
- char *a,*b;
--
-- a = s1;
-+
-+ a = s1;
- b = s2;
- while (*a != '\0') {
- if (tolower(*a) != tolower(*b)) return(_FALSE);
-- a++;
-+ a++;
- b++;
- }
-- *end = b;
-+ *end = b;
- return(_TRUE);
- }
-
-@@ -3791,18 +3799,18 @@ char **end;
- {
- char *s;
- int count = 0;
--
-+
- s = str;
- while ((*s != '\0') && (count < number)) {
-- while ((*s == ' ') || (*s == ',') || (*s == '='))
-+ while ((*s == ' ') || (*s == ',') || (*s == '='))
- s++;
- if (*s != '\0') {
- result[count++] = strtod(s,&s);
- }
- }
-- while ((*s == ' ') || (*s == ',') || (*s == '='))
-+ while ((*s == ' ') || (*s == ',') || (*s == '='))
- s++;
-- *end = s;
-+ *end = s;
- return(count);
- }
-
-@@ -3822,22 +3830,22 @@ char *str;
- int results[4],no;
-
- s = str;
-- while (*s == ' ')
-+ while (*s == ' ')
- s++;
- if ((StrCompare("drawfile",s,&s)) || (StrCompare("DVIview_diagram",s,&s))) {
-
-- if (printdiag == _FALSE)
-+ if (printdiag == _FALSE)
- return(_TRUE); /* it's a diagram, but don't print */
-
-- while ((*s == ' ') || (*s == '='))
-+ while ((*s == ' ') || (*s == '='))
- s++; /* space or '=' separates keyword/keyval */
-
- if (*s == '\0') {
-- fprintf(ERR_STREAM,"No filename given for \\special-diagram!\n");
-+ fprintf(ERR_STREAM,"No filename given for \\special-diagram!\n");
- return(_TRUE);
- }
- sh = diagname;
-- while ((*s != ' ') && (*s != ',') && (*s != '\0'))
-+ while ((*s != ' ') && (*s != ',') && (*s != '\0'))
- *sh++ = *s++;
- *sh = '\0';
-
-@@ -3845,7 +3853,7 @@ char *str;
- dt.scalex = dt.scaley = 100;
- dt.cropl = dt.cropb = dt.cropr = dt.cropt = 0;
- while (*s != '\0') {
-- while ((*s == ' ') || (*s == ','))
-+ while ((*s == ' ') || (*s == ','))
- s++;
- if (*s != '\0') {
- if (StrCompare("scale",s,&s)) {
-@@ -3853,7 +3861,7 @@ char *str;
- fprintf(ERR_STREAM,
- "Too few arguments (%d) given for <scale> - ignored.\n",no);
- }
-- dt.scalex = results[0];
-+ dt.scalex = results[0];
- dt.scaley = results[1];
- }
- else if (StrCompare("crop",s,&s)) {
-@@ -3861,15 +3869,15 @@ char *str;
- fprintf(ERR_STREAM,
- "Too few arguments (%d) given for <crop> - ignored.\n",no);
- }
-- dt.cropl = results[0];
-+ dt.cropl = results[0];
- dt.cropr = results[1];
-- dt.cropt = results[2];
-+ dt.cropt = results[2];
- dt.cropb = results[3];
- }
- else {
- fprintf(ERR_STREAM,"Bad \\special keyword - <%s> ignored\n",s);
- /* skip over this word */
-- while ((*s != ' ') && (*s != ',') && (*s != '=') && (*s != '\0'))
-+ while ((*s != ' ') && (*s != ',') && (*s != '=') && (*s != '\0'))
- s++;
- }
- }
-@@ -3879,7 +3887,7 @@ char *str;
- diagram(diagname,&dt);
- return(_TRUE);
- }
-- else
-+ else
- return(_FALSE);
- }
- # endif /* LJ */
-@@ -3895,70 +3903,58 @@ char *str;
- int n;
- #endif
- {
-- char spbuf[STRSIZE], xs[STRSIZE], ys[STRSIZE];
-- char *sf = NULL, *psfile = NULL;
-+ char xs[STRSIZE], ys[STRSIZE];
-+ char *include_file = NULL;
-+ enum { VerbFile, HPFile, PSFile } file_type;
- float x,y;
- long4 x_pos, y_pos;
- KeyWord k;
- int i, j, j1;
- static int GrayScale = 10, Pattern = 1;
- static bool GrayFill = _TRUE;
-- static long4 p_x[80], p_y[80];
-- int llx=0, lly=0, urx=0, ury=0, rwi=0, rhi=0;
--#ifdef WIN32
-- char *gs_path;
--#endif
-+ static long4 p_x[MAX_SPECIAL_DEFPOINTS], p_y[MAX_SPECIAL_DEFPOINTS];
-+ int llx=0, lly=0, urx=0, ury=0, rwi=0;
-
- str[n] = '\0';
-- spbuf[0] = '\0';
-+ for ( i=0 ; i<MAX_SPECIAL_DEFPOINTS ; i++ )
-+ p_x[i] = p_y[i] = -1;
-
- SetPosn(h, v);
- #ifdef __riscos
- #ifdef LJ
-- if (ParseDiagram(str))
-+ if (ParseDiagram(str))
- return;
- #endif
- #endif
--
-+
- while ( (str = GetKeyStr(str, &k)) != NULL ) {
- /* get all keyword-value pairs */
- /* for compatibility, single words are taken as file names */
- if ( k.vt == None && access(k.Key, 0) == 0) {
-- if ( sf
--#ifdef KPATHSEA
-- && !kpse_tex_hush ("special")
--#endif
-- )
-- Warning("More than one \\special file name given. %s ignored", sf);
-- (void) strcpy(spbuf, k.Key);
-- sf = spbuf;
-- /*
-- for (j = 1; ((sf[j]=='/' ? sf[j]='\\':sf[j]) != '\0'); j++);
-- */
-- } else if ( GetKeyVal( &k, KeyTab, NKEYS, &i ) && i != -1 )
-+ if ( include_file && !kpse_tex_hush ("special") ) {
-+ Warning("More than one \\special file name given. %s ignored", include_file);
-+ free (include_file);
-+ }
-+ include_file = xstrdup(k.Key);
-+ file_type = VerbFile;
-+ } else if ( GetKeyVal( &k, KeyTab, NKEYS, &i ) && i != -1 ) {
- switch (i) {
- case PSFILE:
-- if (sf
--#ifdef KPATHSEA
-- && !kpse_tex_hush ("special")
--#endif
-- )
-- Warning("More than one \\special file name given. %s ignored", sf);
-- (void) strcpy(spbuf, k.Val);
-- psfile = spbuf;
-- /*
-- for (j=1; ((sf[j]=='/' ? sf[j]='\\':sf[j]) != '\0'); j++);
-- */
-+ if ( include_file ) {
-+ Warning("More than one \\special file name given. %s ignored", include_file);
-+ free(include_file);
-+ }
-+ include_file = xstrdup(k.Val);
-+ file_type = PSFile;
- break;
--
-+
- case HPFILE:
-- if (sf)
-- Warning("More than one \\special file name given. %s ignored", sf);
-- (void) strcpy(spbuf, k.Val);
-- sf = spbuf;
-- /*
-- for (j=1; ((sf[j]=='/' ? sf[j]='\\':sf[j]) != '\0'); j++);
-- */
-+ if ( include_file && !kpse_tex_hush ("special") ) {
-+ Warning("More than one \\special file name given. %s ignored", include_file);
-+ free(include_file);
-+ }
-+ include_file = xstrdup(k.Val);
-+ file_type = HPFile;
- break;
-
- case ORIENTATION:
-@@ -3977,24 +3973,26 @@ int n;
- EMIT2("\033&l%dO\033*rF", (unsigned char)k.v.i);
- }
- #endif
-- else
--#ifdef KPATHSEA
-- if (!kpse_tex_hush ("special"))
--#endif
-- Warning( "Invalid orientation (%d)given; ignored.", k.v.i);
-+ else {
-+ Warning( "Invalid orientation (%d) given; ignored.", k.v.i);
-+ }
- break;
-
- case RESETPOINTS:
-- (void) strcpy(spbuf, k.Val);
--
-- sf = NULL;
-+ for ( i=0 ; i<MAX_SPECIAL_DEFPOINTS ; i++ )
-+ p_x[i] = p_y[i] = -1;
- break;
-
- case DEFPOINT:
-- (void) strcpy(spbuf, k.Val);
-- i = sscanf(spbuf,"%d(%[^,],%s)",&j,xs,ys);
-+ /* 254 is STRSIZE-1. cpp should be used to construct that number. */
-+ i = sscanf(k.Val,"%d(%254[^,],%254s)",&j,xs,ys);
- if (i>0) {
-- x_pos = h;
-+ if ( j < 0 || j >= MAX_SPECIAL_DEFPOINTS ) {
-+ Warning ("defpoint %d ignored, must be between 0 and %d",
-+ j, MAX_SPECIAL_DEFPOINTS);
-+ break;
-+ }
-+ x_pos = h;
- y_pos = v;
- if (i>1) {
- if (sscanf(xs,"%fpt",&x)>0) {
-@@ -4010,20 +4008,34 @@ int n;
- }
- p_x[j]=x_pos;
- p_y[j]=y_pos;
-- } else
--#ifdef KPATHSEA
-- if (!kpse_tex_hush ("special"))
--#endif
-- Warning("invalid point definition\n");
--
-- sf = NULL;
-+ } else {
-+ Warning("invalid point definition");
-+ }
- break;
-
- case FILL:
-- (void) strcpy(spbuf, k.Val);
-- i = sscanf(spbuf,"%d/%d %s",&j,&j1,xs);
-+ /* 254 is STRSIZE-1. cpp should be used to construct that number. */
-+ i = sscanf(k.Val,"%d/%d %254s",&j,&j1,xs);
- if (i>1) {
- #ifdef LJ
-+ if ( j < 0 || j >= MAX_SPECIAL_DEFPOINTS ) {
-+ Warning ("fill ignored, point %d must be between 0 and %d",
-+ j, MAX_SPECIAL_DEFPOINTS);
-+ break;
-+ }
-+ if ( p_x[j] == -1 ) {
-+ Warning ("fill ignored, point %d is undefined\n", j);
-+ break;
-+ }
-+ if ( j1 < 0 || j1 >= MAX_SPECIAL_DEFPOINTS ) {
-+ Warning ("fill ignored, point %d must be between 0 and %d",
-+ j1, MAX_SPECIAL_DEFPOINTS);
-+ break;
-+ }
-+ if ( p_x[j1] == -1 ) {
-+ Warning ("fill ignored, point %d is undefined\n", j1);
-+ break;
-+ }
- SetPosn(p_x[j], p_y[j]);
- x_pos = (long4)PIXROUND(p_x[j1]-p_x[j], hconv);
- y_pos = (long4)PIXROUND(p_y[j1]-p_y[j], vconv);
-@@ -4043,22 +4055,18 @@ int n;
- if ((k.v.i >= 0) && (k.v.i < 101)) {
- GrayScale = k.v.i;
- GrayFill = _TRUE;
-- } else
--#ifdef KPATHSEA
-- if (!kpse_tex_hush ("special"))
--#endif
-+ } else {
- Warning( "Invalid gray scale (%d) given; ignored.", k.v.i);
-+ }
- break;
-
- case PATTERN:
- if ((k.v.i >= 0) && (k.v.i < 7)) {
- Pattern = k.v.i;
- GrayFill = _FALSE;
-- } else
--#ifdef KPATHSEA
-- if (!kpse_tex_hush ("special"))
--#endif
-+ } else {
- Warning( "Invalid pattern (%d) given; ignored.", k.v.i);
-+ }
- break;
-
- case LLX: llx = k.v.i; break;
-@@ -4066,103 +4074,161 @@ int n;
- case URX: urx = k.v.i; break;
- case URY: ury = k.v.i; break;
- case RWI: rwi = k.v.i; break;
-- case RHI: rhi = k.v.i; break;
-+ case RHI:
-+ if (!kpse_tex_hush ("special"))
-+ Warning("Whatever rhi was good for once, it is ignored now.");
-+ break;
-
- default:
--#ifdef KPATHSEA
-- if (!kpse_tex_hush ("special"))
--#endif
-- Warning("Can't handle %s=%s command; ignored.", k.Key, k.Val);
-+ if ( !kpse_tex_hush ("special") )
-+ Warning("Can't handle %s=%s command; ignored.", k.Key, k.Val);
- break;
- }
--
-- else
--#ifdef KPATHSEA
-- if (!kpse_tex_hush ("special"))
--#endif
-+
-+ } else if (!kpse_tex_hush ("special")) {
- Warning("Invalid keyword or value in \\special - <%s> ignored", k.Key);
-+ }
-+
-+ free (k.Key);
-+ if ( k.Val != NULL ) free(k.Val);
- }
-
-- if ( sf || psfile ) {
-+ if ( include_file ) {
- last_rx = last_ry = UNKNOWN;
- #ifdef IBM3812
- PMPflush;
- #endif
-- if (sf) {
-- if (i == HPFILE)
-- CopyHPFile( sf );
-- else
-- CopyFile( sf );
-- }
-- else
-+
- #ifdef LJ
-- if (psfile) {
-- /* int height = rwi * (urx - llx) / (ury - lly);*/
-- int width = urx - llx;
-- int height = ury - lly;
-- char cmd[255];
-- int scale_factor = 3000 * width / rwi;
-- int adjusted_height = height * 300/scale_factor;
-- int adjusted_llx = llx * 300/scale_factor;
-- char *printer = "ljetplus"; /* use the most stupid one */
--
--
-- char scale_file_name[255];
-- char *scale_file = tmpnam(scale_file_name);
-- char *pcl_file = tmpnam(NULL);
-- FILEPTR scalef;
--
-- if ( (scalef = BOUTOPEN(scale_file)) == FPNULL ) {
-- Warning("Unable to open file %s for writing", scale_file );
-- return;
-- }
-- fprintf(scalef, "%.2f %.2f scale\n%d %d translate\n",
-- 300.0/scale_factor, 300.0/scale_factor,
-- 0, adjusted_height == height ? 0 : ury);
-- BCLOSE( scalef );
-+ if ( file_type == PSFile) {
-+ /* int height = rwi * (urx - llx) / (ury - lly);*/
-+ int width = urx - llx;
-+ int height = ury - lly;
-+ char cmd[255];
-+ char *cmd_format = "%s -q -dSIMPLE -dSAFER -dNOPAUSE -sDEVICE=%s -sOutputFile=%s %s %s showpage.ps -c quit";
-+ char *gs_cmd;
-+ int scale_factor, adjusted_height, adjusted_llx;
-+ char *printer = "ljetplus"; /* use the most stupid one */
-+
-+ char pcl_file[STRSIZE];
-+ char scale_file[STRSIZE];
-+ FILEPTR scalef;
-+
-+ if ( urx == 0 || ury == 0 || rwi == 0 ) {
-+ /* Since dvips' psfile special has a different syntax, this might
-+ well be one of those specials, i.e., a non-dviljk special. Then
-+ the Warning should be suppressable. */
-+ if ( !kpse_tex_hush ("special") )
-+ Warning ("Ignoring psfile special without urx, ury and rwi attributes");
-+ free (include_file);
-+ return;
-+ }
-+ scale_factor = 3000 * width / rwi;
-+ adjusted_height = height * 300/scale_factor;
-+ adjusted_llx = llx * 300/scale_factor;
-+
-+ /* We cannot use mkstemp, as we cannot pass two open file descriptors
-+ portably to Ghostscript. We don't want to use tmpnam() or tempnam()
-+ either, as they have tempfile creation race conditions. Instead we
-+ create a temporary directory with mkdtemp() -- if that's available.
-+ If not, we are thrown back to tempnam(), to get our functionality
-+ at all. We need to create the temporary directory only once per
-+ run; it will be deleted in AllDone(). */
-+ if ( tmp_dir[0] == '\0' ) {
-+ char * base_dir;
-+ if ( (base_dir = getenv("TMPDIR")) == NULL ) {
-+ base_dir = "/tmp";
-+ } else if ( strlen(base_dir) > STRSIZE - sizeof("/dviljkXXXXXX/include.pcl") ) {
-+ Warning ("TMPDIR %s is too long, using /tmp instead", base_dir);
-+ base_dir = "/tmp";
-+ }
-+ if ( base_dir[0] == '/' && base_dir[1] == '\0' ) {
-+ Warning ("Feeling naughty, do we? / is no temporary directory, dude");
-+ base_dir = "/tmp";
-+ }
-+ strcpy (tmp_dir, base_dir);
-+ strcat (tmp_dir, "/dviljkXXXXXX");
-+ if ( mkdtemp(tmp_dir) == NULL ) {
-+ Warning ("Could not create temporary directory %s, errno = %d; ignoring include file special",
-+ tmp_dir, errno);
-+ return;
-+ }
-+ }
-+ strcpy(pcl_file, tmp_dir);
-+ strcat(pcl_file, "/include.pcl");
-+ strcpy(scale_file, tmp_dir);
-+ strcat(scale_file, "/scale.ps");
-+
-+ if ( (scalef = BOUTOPEN(scale_file)) == FPNULL ) {
-+ Warning("Unable to open file %s for writing", scale_file );
-+ free (include_file);
-+ unlink(scale_file); /* ignore error */
-+ return;
-+ }
-+ fprintf(scalef, "%.2f %.2f scale\n%d %d translate\n",
-+ 300.0/scale_factor, 300.0/scale_factor,
-+ 0, adjusted_height == height ? 0 : ury);
-+ BCLOSE( scalef );
-
- #ifdef WIN32
-- gs_path = getenv("GS_PATH");
-- if (!gs_path)
-- gs_path = "gswin32c.exe";
-- sprintf(cmd,"%s -q -dSIMPLE -dSAFER -dNOPAUSE -sDEVICE=%s -sOutputFile=%s %s %s showpage.ps -c quit",
-- gs_path, printer, pcl_file, scale_file, psfile);
--#else
-- sprintf(cmd,"gs -q -dSIMPLE -dSAFER -dNOPAUSE -sDEVICE=%s -sOutputFile=%s %s %s showpage.ps -c quit",
-- printer, pcl_file, scale_file, psfile);
--#endif
--#ifdef DEBUGGS
-- fprintf(stderr,
-- "PS-file '%s' w=%d, h=%d, urx=%d, ury=%d, llx=%d, lly=%d, rwi=%d\n",
-- psfile, urx - llx, height, urx,ury,llx,lly, rwi);
-- fprintf(stderr,"%s\n",cmd);
-+ if ( (gs_cmd = getenv("GS_PATH")) == NULL )
-+ gs_cmd = "gswin32c.exe";
-+#else
-+ gs_cmd = "gs";
- #endif
-- if (system(cmd)) {
-- Warning("execution of '%s' returned an error", cmd);
-- } else {
--#ifdef DEBUGGS
-- fprintf(stderr, "o=%d, h=%d, so=%d, sh=%d\n",
-- llx, height, adjusted_llx, adjusted_height);
--
-- fprintf(stderr, "OLD x=%d, y=%d\n",
-- (int)PIXROUND(h, hconv) + x_goffset,
-- (int)PIXROUND(v, vconv) + y_goffset);
--#endif
-- v -= 65536l*adjusted_height; /**300/scale_factor;*/
-- h -= 65536l*adjusted_llx; /* *300/scale_factor;*/
-- SetPosn(h, v);
--#ifdef DEBUGGS
-- fprintf(stderr, "NEW x=%d, y=%d\n",
-- (int)PIXROUND(h, hconv) + x_goffset,
-- (int)PIXROUND(v, vconv) + y_goffset);
--#endif
--
-- CopyHPFile( pcl_file );
-- /* unlink(pcl_file); */
-- /* unlink(scale_file); */
-- }
-+ if ( strlen(cmd_format)-10 + strlen(gs_cmd) + strlen(printer) +
-+ strlen(pcl_file) + strlen(scale_file) + strlen(include_file) +1 >
-+ sizeof(cmd) ) {
-+ Warning ("Ghostscript command for %s would be too long, skipping special", include_file);
-+ free (include_file);
-+ unlink(scale_file); /* ignore errors */
-+ unlink(pcl_file);
-+ return;
-+ }
-+ sprintf(cmd, cmd_format,
-+ gs_cmd, printer, pcl_file, scale_file, include_file);
-+#ifdef DEBUGGS
-+ fprintf(stderr,
-+ "PS-file '%s' w=%d, h=%d, urx=%d, ury=%d, llx=%d, lly=%d, rwi=%d\n",
-+ include_file, urx - llx, height, urx,ury,llx,lly, rwi);
-+ fprintf(stderr,"%s\n",cmd);
-+#endif
-+ if (system(cmd)) {
-+ Warning("execution of '%s' returned an error", cmd);
-+ } else {
-+#ifdef DEBUGGS
-+ fprintf(stderr, "o=%d, h=%d, so=%d, sh=%d\n",
-+ llx, height, adjusted_llx, adjusted_height);
-+
-+ fprintf(stderr, "OLD x=%d, y=%d\n",
-+ (int)PIXROUND(h, hconv) + x_goffset,
-+ (int)PIXROUND(v, vconv) + y_goffset);
-+#endif
-+ v -= 65536l*adjusted_height; /**300/scale_factor;*/
-+ h -= 65536l*adjusted_llx; /* *300/scale_factor;*/
-+ SetPosn(h, v);
-+#ifdef DEBUGGS
-+ fprintf(stderr, "NEW x=%d, y=%d\n",
-+ (int)PIXROUND(h, hconv) + x_goffset,
-+ (int)PIXROUND(v, vconv) + y_goffset);
-+#endif
-+
-+ CopyHPFile( pcl_file );
- }
-+ unlink(scale_file); /* ignore errors */
-+ unlink(pcl_file);
-+ }
-+ else
- #endif /* LJ */
-+
-+ if ( file_type == HPFile )
-+ CopyHPFile( include_file );
-+ else if ( file_type == VerbFile )
-+ CopyFile( include_file );
-+ else
-+ Warning ("This can't happen: unknown file_type value %d", file_type);
-+
-+ if ( include_file != NULL ) free(include_file);
- }
- }
-
-@@ -4173,12 +4239,11 @@ int n;
- /**********************************************************************/
- /***************************** GetKeyStr ****************************/
- /**********************************************************************/
--/* extract first keyword-value pair from string (value part may be null)
-- * return pointer to remainder of string
-- * return NULL if none found
-+/* Extract first keyword-value pair from string (value part may be null),
-+ * keyword and value are allocated and must be free by caller.
-+ * Return pointer to remainder of string,
-+ * return NULL if none found.
- */
--char KeyStr[STRSIZE];
--char ValStr[STRSIZE];
- #if NeedFunctionPrototypes
- char *GetKeyStr(char *str, KeyWord *kw )
- #else
-@@ -4187,39 +4252,46 @@ char *str;
- KeyWord *kw;
- #endif
- {
-- char *s, *k, *v, t;
-+ char *s, *start;
-+ char save_char, quote_char;
- if ( !str )
- return( NULL );
- for (s = str; *s == ' '; s++)
- ; /* skip over blanks */
- if (*s == '\0')
- return( NULL );
-- for (k = KeyStr; /* extract keyword portion */
-- *s != ' ' && *s != '\0' && *s != '=';
-- *k++ = *s++)
-- ;
-- *k = '\0';
-- kw->Key = KeyStr;
-- kw->Val = v = NULL;
-+ start = s++; /* start of keyword */
-+ while ( *s != ' ' && *s != '\0' && *s != '=' ) /* locate end */
-+ s++;
-+ save_char = *s;
-+ *s = '\0';
-+ kw->Key = xstrdup(start);
-+ kw->Val = NULL;
- kw->vt = None;
-- for ( ; *s == ' '; s++)
-- ; /* skip over blanks */
-- if ( *s != '=' ) /* look for "=" */
-+ if ( save_char == '\0' ) /* shortcut when we're at the end */
-+ return (s);
-+ *s = save_char; /* restore keyword end char */
-+ while ( *s == ' ' ) s++ ; /* skip over blanks */
-+ if ( *s != '=' ) /* no "=" means no value */
- return( s );
-- for (s++; *s == ' '; s++); /* skip over blanks */
-- if ( *s == '\'' || *s == '\"' ) /* get string delimiter */
-- t = *s++;
-+ for (s++; *s == ' '; s++)
-+ ; /* skip over blanks */
-+ if ( *s == '\'' || *s == '\"' ) /* get string delimiter */
-+ quote_char = *s++;
- else
-- t = ' ';
-- for (v = ValStr; /* copy value portion up to delim */
-- *s != t && *s != '\0';
-- *v++ = *s++)
-- ;
-- if ( t != ' ' && *s == t )
-- s++;
-- *v = '\0';
-- kw->Val = ValStr;
-+ quote_char = ' ';
-+ start = s; /* no increment, might be "" as value */
-+ while ( *s != quote_char && *s != '\0' )
-+ s++; /* locate end of value portion */
-+ save_char = *s;
-+ *s = '\0';
-+ kw->Val = xstrdup(start);
- kw->vt = String;
-+ if ( save_char != '\0' ) { /* save_char is now quote_char */
-+ *s = save_char;
-+ if ( quote_char != ' ' ) /* we had real quote chars */
-+ s++;
-+ }
- return( s );
- }
-
-@@ -4281,7 +4353,7 @@ char *a, *b;
- #endif
- {
- char *x, *y;
--
-+
- for (x = a, y = b; *a; a++, b++)
- if ( tolower(*a) != tolower(*b) )
- return( _FALSE );
-@@ -4469,10 +4541,10 @@ int Set;
- * process for simplicity always horizontally
- */
-
-- /*
-+ /*
- fprintf(ERR_STREAM,"large box: w=%d,x=%d,y=%d\n",(int)yy,(int)xx,0);
- */
--
-+
- hor_offset = HOR_HALF(30);
- MoveHor(hor_offset);
- vert_offset = VERT_HALF(30);
-@@ -4547,7 +4619,7 @@ int Set;
- yy += (long4)pgsiz_dots - (long4)last_ry;
-
- if ((yy>0) && (xx>0))
-- EMIT4("\033*p-%ldY\033*c%lda%ldbP",
-+ EMIT4("\033*p-%ldY\033*c%lda%ldbP",
- (long)yy - 1, (long)xx, (long)yy);
- #endif
- last_rx = last_ry = UNKNOWN; /* next time full positioning */
-@@ -4708,7 +4780,7 @@ void OpenFontFile()
- if ((fid = pixel_files[least_used].pixel_file_id) != NO_FILE) {
- /* mark file as being closed in the entry */
- fp = hfontptr;
-- while (fp != NULL && fp->font_file_id != fid)
-+ while (fp != NULL && fp->font_file_id != fid)
- fp = fp->next;
- if (fp == NULL)
- Fatal("Open file %x not found in font entry list.\n", fid);
-@@ -4763,9 +4835,9 @@ void OpenFontFile()
- while ((fp != NULL) && (fp->font_file_id != f))
- fp = fp->next;
-
-- if (fp == NULL)
-+ if (fp == NULL)
- Fatal("Open file %x not found in font entry list.\n",f);
-- else
-+ else
- fp->font_file_id = FPNULL;
- }
- BCLOSE(f);
-@@ -4819,13 +4891,14 @@ struct font_entry *fontptr;
- the resident fonts. */
- if (tfm_read_info(fontptr->n, &tfm_info)
- && tfm_info.family[0]
-- && strcmp((char *)tfm_info.family, "HPAUTOTFM") == 0) {
-+ && EQ((char *)tfm_info.family, "HPAUTOTFM")) {
- unsigned i;
- double factor = fontptr->s / (double)0x100000;
-
- resident_count++;
- fontptr->resident_p = _TRUE;
-- strcpy(fontptr->symbol_set, (char *)tfm_info.coding_scheme);
-+ strncpy(fontptr->symbol_set, (char *)tfm_info.coding_scheme, 39);
-+ fontptr->symbol_set[39] = '\0';
- fontptr->resid = tfm_info.typeface_id;
- fontptr->spacing = tfm_info.spacing;
- fontptr->style = tfm_info.style;
-@@ -4878,7 +4951,7 @@ struct font_entry *fontptr;
- fontptr->resident_p = _FALSE;
-
- if (tfm_info.family[0]
-- && strcmp((char *)tfm_info.family, "UNSPECIFIED") == 0) {
-+ && EQ((char *)tfm_info.family, "UNSPECIFIED")) {
- Warning("font family for %s is UNSPECIFIED; need to run dvicopy?",
- fontptr->n);
- fontptr->font_file_id = NO_FILE;
-@@ -5005,7 +5078,7 @@ long4 k;
- GetBytes(dvifp, tfontptr->n, tfontptr->a + tfontptr->l);
- tfontptr->n[tfontptr->a+tfontptr->l] = '\0';
-
-- tfontptr->font_mag =
-+ tfontptr->font_mag =
- (long4)((ActualFactor((long4)(1000.0*tfontptr->s/(double)tfontptr->d+0.5))
- * ActualFactor(mag)
- #ifdef USEPXL
-@@ -5031,10 +5104,9 @@ printf("[%ld]=%lf * %lf * %lf + 0.5 = %l
- if (tfontptr->resident_p)
- return;
-
-- if (!(resident_font_located)) {
-+ if (!(resident_font_located))
- #endif
-
--#ifdef KPATHSEA
- {
- kpse_glyph_file_type font_ret;
- char *name;
-@@ -5042,14 +5114,14 @@ printf("[%ld]=%lf * %lf * %lf + 0.5 = %l
- = kpse_magstep_fix ((unsigned) (tfontptr->font_mag / 5.0 + .5),
- RESOLUTION, NULL);
- tfontptr->font_mag = dpi * 5; /* save correct dpi */
--
-+
- name = kpse_find_pk (tfontptr->n, dpi, &font_ret);
- if (name)
- {
- font_found = _TRUE;
-- strcpy (tfontptr->name, name);
-- free (name);
--
-+ tfontptr->name = name;
-+ allocated_storage += strlen(name)+1;
-+
- if (!FILESTRCASEEQ (tfontptr->n, font_ret.name)) {
- fprintf (stderr,
- "dvilj: Font %s not found, using %s at %d instead.\n",
-@@ -5071,29 +5143,6 @@ printf("[%ld]=%lf * %lf * %lf + 0.5 = %l
- tfontptr->n, dpi);
- }
- }
--#else /* not KPATHSEA */
-- if (!(findfile(PXLpath,
-- tfontptr->n,
-- tfontptr->font_mag,
-- tfontptr->name,
-- _FALSE,
-- 0))) {
-- Warning(tfontptr->name); /* contains error messsage */
-- tfontptr->font_file_id = NO_FILE;
--#ifdef __riscos
-- MakeMetafontFile(PXLpath, tfontptr->n, tfontptr->font_mag);
--#endif
-- }
-- else {
-- font_found = _TRUE;
-- if (G_verbose)
-- fprintf(ERR_STREAM,"%d: using font <%s>\n", plusid, tfontptr->name);
-- }
--#endif /* not KPATHSEA */
--
--#ifdef LJ_RESIDENT_FONTS
-- }
--#endif
-
- tfontptr->plusid = plusid;
- plusid++;
-@@ -5107,7 +5156,7 @@ printf("[%ld]=%lf * %lf * %lf + 0.5 = %l
- HANDLE_MAX_FONTS);
- #endif
- if (tfontptr != pfontptr) {
-- if (font_found)
-+ if (font_found)
- OpenFontFile();
- else
- pxlfp = NO_FILE;
-@@ -5146,7 +5195,7 @@ printf("[%ld]=%lf * %lf * %lf + 0.5 = %l
- if (t == PK_PRE) {
- unsigned char temp_byte;
- temp_byte = (unsigned char) NoSignExtend(pxlfp, 1);
-- if (temp_byte != PK_ID)
-+ if (temp_byte != PK_ID)
- Fatal( "Wrong Version of pk file! (%d should be 89)\n",
- (int)temp_byte);
- else
-@@ -5163,7 +5212,7 @@ printf("[%ld]=%lf * %lf * %lf + 0.5 = %l
-
- tfontptr->magnification = NoSignExtend(pxlfp, 4);
- tfontptr->designsize = NoSignExtend(pxlfp, 4);
--
-+
- if (tfontptr->id == id1001)
- FSEEK(pxlfp, (long)(NoSignExtend(pxlfp, 4) * 4), SEEK_SET);
- else
-@@ -5232,7 +5281,7 @@ printf("[%ld]=%lf * %lf * %lf + 0.5 = %l
- hppp = NoSignExtend(pxlfp, 4);
- vppp = NoSignExtend(pxlfp, 4);
- if (hppp != vppp)
-- Warning("aspect ratio is %ld:%ld (should be 1:1)!",
-+ Warning("aspect ratio is %ld:%ld (should be 1:1)!",
- (long)hppp, (long)vppp);
- tfontptr->magnification = (long4)(hppp * 72.27 * 5 / 65536l + 0.5);
-
-@@ -5515,7 +5564,7 @@ void SkipFontDef()
- {
- int a, l;
- char n[STRSIZE];
--
-+
- (void) NoSignExtend(dvifp, 4);
- (void) NoSignExtend(dvifp, 4);
- (void) NoSignExtend(dvifp, 4);
-@@ -5524,7 +5573,7 @@ void SkipFontDef()
- GetBytes(dvifp, n, a + l);
- }
-
--
-+
-
- /*------------------------ end dvifont.c -------------------------------*/
-
-@@ -5598,7 +5647,7 @@ Warning(va_alist)
- #endif
- if ( G_nowarn || G_quiet )
- return;
--
-+
- fprintf(ERR_STREAM, "%s: warning: ", G_progname);
- vfprintf(ERR_STREAM, fmt, args);
- fprintf(ERR_STREAM, "\n");
diff --git a/print/teTeX3-bin/patches/patch-au b/print/teTeX3-bin/patches/patch-au
deleted file mode 100644
index 8956457bf3d..00000000000
--- a/print/teTeX3-bin/patches/patch-au
+++ /dev/null
@@ -1,106 +0,0 @@
-$NetBSD: patch-au,v 1.3 2009/01/20 23:56:58 sketch Exp $
-
---- texk/dviljk/dvi2xx.h.orig 1999-03-16 07:03:33.000000000 +0000
-+++ texk/dviljk/dvi2xx.h 2009-01-20 23:47:46.847736250 +0000
-@@ -8,10 +8,14 @@
- /* #define LJ */
- /* #define DRAWGLYPH */
-
-+#ifndef HAVE_MKDTEMP
-+extern char *mkdtemp(char *path);
-+#endif
-+
- #ifdef KPATHSEA
- #include <kpathsea/config.h>
-+#include <kpathsea/c-std.h>
- #include <kpathsea/c-limits.h>
--#include <kpathsea/c-memstr.h>
- #include <kpathsea/magstep.h>
- #include <kpathsea/proginit.h>
- #include <kpathsea/progname.h>
-@@ -24,6 +28,7 @@
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
-+#include <unistd.h>
- #ifdef unix
- #include <limits.h>
- #endif
-@@ -41,9 +46,6 @@
- #ifdef MSC5
- #include <dos.h> /* only for binaryopen on device */
- #endif
--#if defined (unix) && !defined (KPATHSEA)
--#include <limits.h>
--#endif
-
-
- #include "config.h"
-@@ -116,6 +118,7 @@
- #define HUGE_SIZE (unsigned char) 2
- #define HUGE_CHAR_PATTERN 32767l
- #define BYTES_PER_PIXEL_LINE 500 /* max number of bytes per pixel line */
-+#define MAX_SPECIAL_DEFPOINTS 80 /* max number of defpoint specials */
-
-
- #define PK_POST 245
-@@ -281,7 +284,14 @@
- #define VisChar(c) (unsigned char)(c)
- #endif
-
--#define GetBytes(fp,buf,n) read_multi(buf,1,n,fp) /* used to be a function */
-+/* Used to be a function. buf is always an array, never a pointer.
-+ Without that invariant, we would have to introduce full dynamic
-+ memory management in this driver -- probably it would be easier to
-+ write a new one. [27 Jun 07 -js] */
-+#define GetBytes(fp,buf,n) \
-+ ( sizeof(buf) != sizeof(void *) && sizeof(buf) > n ? \
-+ (void)read_multi(buf, 1, n, fp) \
-+ : Fatal("Try to read %d bytes in an array of size %d", n, sizeof(buf)) )
-
-
- /**********************************************************************/
-@@ -307,6 +317,7 @@
- int sscanf();
- int strcmp();
- char *strcpy();
-+char *strncpy();
- # ifdef MSC5
- unsigned int strlen();
- # endif
-@@ -393,7 +404,7 @@
- char n[STRSIZE]; /* FNT_DEF command parameters */
- long4 font_mag; /* computed from FNT_DEF s and d parameters */
- /*char psname[STRSIZE];*/ /* PostScript name of the font */
-- char name[STRSIZE]; /* full name of PXL file */
-+ char *name; /* full name of PXL file */
- FILEPTR font_file_id; /* file identifier (NO_FILE if none) */
- #ifdef USEPXL
- long4 magnification; /* magnification read from PXL file */
-@@ -487,8 +498,8 @@
- long4 NoSignExtend DVIPROTO((FILEPTR, int));
- void OpenFontFile DVIPROTO((void));
- long4 PixRound DVIPROTO((long4, long4));
--void PkRaster DVIPROTO((struct char_entry *, int));
--void RasterLine DVIPROTO((struct char_entry *, unsigned int,
-+void PkRaster DVIPROTO((struct char_entry *, int));
-+void RasterLine DVIPROTO((struct char_entry *, unsigned int,
- unsigned int, unsigned char *));
- void RasterChar DVIPROTO((struct char_entry *));
- void ReadFontDef DVIPROTO((long4));
-@@ -534,11 +545,12 @@
- #ifndef KPATHSEA
- char *PXLpath = FONTAREA;
- #endif
--char G_progname[STRSIZE]; /* program name */
--char filename[STRSIZE]; /* DVI file name */
--char rootname[STRSIZE]; /* DVI filename without extension */
-+char *G_progname; /* program name */
-+char *filename; /* DVI file name */
-+char *rootname; /* DVI filename without extension */
- char *HeaderFileName = ""; /* file name & path of Headerfile */
- char *EmitFileName = ""; /* file name & path for output */
-+char tmp_dir[STRSIZE] = ""; /* temporary directory for auxilliary files */
- #ifdef IBM3812
- bool FirstAlternate = _FALSE; /* first page from alternate casette ? */
- #endif
diff --git a/print/teTeX3-bin/patches/patch-av b/print/teTeX3-bin/patches/patch-av
deleted file mode 100644
index d54ad0c04ae..00000000000
--- a/print/teTeX3-bin/patches/patch-av
+++ /dev/null
@@ -1,67 +0,0 @@
-$NetBSD: patch-av,v 1.1 2008/08/24 20:35:37 tonnerre Exp $
-
---- texk/dviljk/configure.orig 2008-08-24 20:52:04.000000000 +0200
-+++ texk/dviljk/configure
-@@ -1286,6 +1286,62 @@ cat >> confdefs.h <<EOF
- EOF
-
-
-+for ac_func in rmdir unlink mkdtemp
-+do
-+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-+echo "configure:1243: checking for $ac_func" >&5
-+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
-+ echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+ cat > conftest.$ac_ext <<EOF
-+#line 1248 "configure"
-+#include "confdefs.h"
-+/* System header to define __stub macros and hopefully few prototypes,
-+ which can conflict with char $ac_func(); below. */
-+#include <assert.h>
-+/* Override any gcc2 internal prototype to avoid an error. */
-+/* We use char because int might match the return type of a gcc2
-+ builtin and then its argument prototype would still apply. */
-+char $ac_func();
-+
-+int main() {
-+
-+/* The GNU C library defines this for functions which it implements
-+ to always fail with ENOSYS. Some functions are actually named
-+ something starting with __ and the normal name is an alias. */
-+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-+choke me
-+#else
-+$ac_func();
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:1271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=yes"
-+else
-+ echo "configure: failed program was:" >&5
-+ cat conftest.$ac_ext >&5
-+ rm -rf conftest*
-+ eval "ac_cv_func_$ac_func=no"
-+fi
-+rm -f conftest*
-+fi
-+
-+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
-+ echo "$ac_t""yes" 1>&6
-+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-+ cat >> confdefs.h <<EOF
-+#define $ac_tr_func 1
-+EOF
-+
-+else
-+ echo "$ac_t""no" 1>&6
-+fi
-+done
-+
-+
-
- trap '' 1 2 15
- cat > confcache <<\EOF
diff --git a/print/teTeX3-bin/patches/patch-aw b/print/teTeX3-bin/patches/patch-aw
deleted file mode 100644
index ef68e756e00..00000000000
--- a/print/teTeX3-bin/patches/patch-aw
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-aw,v 1.1 2008/08/24 20:35:37 tonnerre Exp $
-
---- texk/dviljk/c-auto.in.orig 2008-08-24 21:24:31.000000000 +0200
-+++ texk/dviljk/c-auto.in
-@@ -7,3 +7,12 @@
-
- /* The number of bytes in a long. */
- #undef SIZEOF_LONG
-+
-+/* Presence of the rmdir() function. */
-+#undef HAVE_RMDIR
-+
-+/* Presence of the unlink() function. */
-+#undef HAVE_UNLINK
-+
-+/* Presence of the mkdtemp() function. */
-+#undef HAVE_MKDTEMP
diff --git a/print/teTeX3-bin/patches/patch-ax b/print/teTeX3-bin/patches/patch-ax
deleted file mode 100644
index 330b3132f80..00000000000
--- a/print/teTeX3-bin/patches/patch-ax
+++ /dev/null
@@ -1,112 +0,0 @@
-$NetBSD: patch-ax,v 1.1 2008/08/24 20:35:37 tonnerre Exp $
-
---- /dev/null 2008-08-24 22:23:22.000000000 +0200
-+++ texk/dviljk/mkdtemp.c 2008-08-24 22:23:18.000000000 +0200
-@@ -0,0 +1,107 @@
-+/*
-+ * Copyright (c) 1987, 1993
-+ * The Regents of the University of California. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * 3. Neither the name of the University nor the names of its contributors
-+ * may be used to endorse or promote products derived from this software
-+ * without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#include <c-auto.h>
-+#ifdef KPATHSEA
-+#include <kpathsea/config.h>
-+#include <kpathsea/c-std.h>
-+#include <kpathsea/c-limits.h>
-+#include <kpathsea/magstep.h>
-+#include <kpathsea/proginit.h>
-+#include <kpathsea/progname.h>
-+#include <kpathsea/tex-glyph.h>
-+#include <kpathsea/tex-hush.h>
-+#include <kpathsea/tex-make.h>
-+#include <kpathsea/c-vararg.h>
-+#else
-+#include <string.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#ifdef unix
-+#include <limits.h>
-+#endif
-+#endif /* KPATHSEA */
-+
-+#include <signal.h>
-+#include <ctype.h>
-+#ifdef vms
-+#include <file.h>
-+#else
-+# ifndef __riscos
-+# include <fcntl.h>
-+# endif
-+#endif
-+#ifdef MSC5
-+#include <dos.h> /* only for binaryopen on device */
-+#endif
-+
-+#ifndef HAVE_MKDTEMP
-+
-+char *
-+mkdtemp(path)
-+ char *path;
-+{
-+ char *tmppath;
-+
-+ assert(path != NULL);
-+
-+ tmppath = malloc(strlen(path));
-+ assert(tmppath);
-+
-+ for (;;)
-+ {
-+ /* Reset string */
-+ strcpy(tmppath, path);
-+
-+ if (!mktemp(tmppath))
-+ {
-+ free(tmppath);
-+ return NULL;
-+ }
-+
-+ if (!mkdir(tmppath, 0700))
-+ {
-+ /* Write back to user buffer. */
-+ strcpy(path, tmppath);
-+ free(tmppath);
-+ return path;
-+ }
-+
-+ if (errno != EEXIST)
-+ {
-+ free(tmppath);
-+ return NULL;
-+ }
-+ }
-+
-+ return NULL; /* Not reached */
-+}
-+
-+#endif /* !HAVE_NBTOOL_CONFIG_H || !HAVE_MKDTEMP */
diff --git a/print/teTeX3-bin/patches/patch-ay b/print/teTeX3-bin/patches/patch-ay
deleted file mode 100644
index 797b4339c2a..00000000000
--- a/print/teTeX3-bin/patches/patch-ay
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ay,v 1.1 2008/08/24 20:35:37 tonnerre Exp $
-
---- texk/dviljk/Makefile.in.orig 2008-08-24 22:14:59.000000000 +0200
-+++ texk/dviljk/Makefile.in
-@@ -9,7 +9,7 @@ ac_include ../make/programs.mk
-
- prog_cflags = -DKPATHSEA
-
--common_objects = tfm.o
-+common_objects = tfm.o mkdtemp.o
-
- program = dvilj
- objects = dvilj.o $(common_objects)
diff --git a/print/teTeX3-bin/patches/patch-az b/print/teTeX3-bin/patches/patch-az
deleted file mode 100644
index 607423177e5..00000000000
--- a/print/teTeX3-bin/patches/patch-az
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-az,v 1.1 2009/01/08 22:09:35 minskim Exp $
-
---- texk/Makefile.in.orig 2005-01-21 01:11:48.000000000 -0800
-+++ texk/Makefile.in
-@@ -36,7 +36,7 @@ default all: do-kpathsea
- (cd $$d && $(MAKE) $(makeargs) $@) || exit 1; else true; fi; done
-
- install install-data install-exec:
-- for d in kpathsea $(programs); do if test -f $$d/Makefile; then \
-+ for d in $(programs); do if test -f $$d/Makefile; then \
- (cd $$d && $(MAKE) $(installargs) $@) || exit 1; else true; fi; done
-
- # Other standard targets for everything.
-@@ -59,7 +59,7 @@ distclean realclean::
- # Unconditionally remake the library, since we don't want to write out
- # the dependencies here.
- do-kpathsea:
-- cd $(kpathsea_dir) && $(MAKE) $(makeargs)
-+ true
-
- # Targets that only apply to web2c.
- triptrap trip trap mptrap \
diff --git a/print/teTeX3-bin/patches/patch-ba b/print/teTeX3-bin/patches/patch-ba
deleted file mode 100644
index 31bde171dfd..00000000000
--- a/print/teTeX3-bin/patches/patch-ba
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-ba,v 1.1 2009/01/08 22:09:35 minskim Exp $
-
---- texk/web2c/kpathsea.mk.orig 1999-01-12 11:11:00.000000000 -0800
-+++ texk/web2c/kpathsea.mk
-@@ -1,7 +1,7 @@
- # web2c/kpathsea.mk -- In subdirectories of web2c, the build directory
- # for kpathsea is one more level up. c_auto_h_dir is used by make depend.
--kpathsea_parent = ../..
--c_auto_h_dir = ..
-+kpathsea_parent = $(KPATHSEA_PREFIX)/include
-+c_auto_h_dir = $(KPATHSEA_PREFIX)/include/kpathsea
-
--prog_cflags = -I.. -I$(srcdir)/..
-+prog_cflags = -I$(KPATHSEA_PREFIX)/include -I$(srcdir)/..
- # End of web2c/kpathsea.mk.
diff --git a/print/teTeX3-bin/patches/patch-bb b/print/teTeX3-bin/patches/patch-bb
deleted file mode 100644
index 37c917f26df..00000000000
--- a/print/teTeX3-bin/patches/patch-bb
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-bb,v 1.1 2009/01/08 22:09:35 minskim Exp $
-
---- texk/make/common.mk.orig 2004-08-06 11:40:50.000000000 -0700
-+++ texk/make/common.mk
-@@ -50,11 +50,11 @@ UNINSTALL_LIBTOOL_LIBS = $(LIBTOOL) --mo
- UNINSTALL_LIBTOOL_PROG = $(LIBTOOL) --mode=uninstall $(RM)
-
- # We use these for many things.
--kpathsea_parent = ..
-+kpathsea_parent = $(KPATHSEA_PREFIX)/include
- kpathsea_dir = $(kpathsea_parent)/kpathsea
- kpathsea_srcdir_parent = $(top_srcdir)/..
--kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea
--kpathsea = $(kpathsea_dir)/libkpathsea.la
-+kpathsea_srcdir = $(KPATHSEA_PREFIX)/include/kpathsea
-+kpathsea = $(KPATHSEA_PREFIX)/lib/libkpathsea.la
-
- @MAINT@ifeq ($(CC), gcc)
- @MAINT@XDEFS = -Wpointer-arith $(warn_more)
diff --git a/print/teTeX3-bin/patches/patch-bc b/print/teTeX3-bin/patches/patch-bc
deleted file mode 100644
index 830b8cb4e46..00000000000
--- a/print/teTeX3-bin/patches/patch-bc
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-bc,v 1.1 2009/01/08 22:09:35 minskim Exp $
-
---- texk/make/tkpathsea.mk.orig 2002-11-16 11:35:14.000000000 -0800
-+++ texk/make/tkpathsea.mk
-@@ -3,10 +3,9 @@ makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='
-
- # This is wrong: the library doesn't depend on kpsewhich.c or
- # acconfig.h. But what to do?
--$(kpathsea): $(kpathsea_srcdir)/*.c $(kpathsea_srcdir)/*.h \
-- $(kpathsea_srcdir)/texmf.in $(top_srcdir)/../make/paths.mk
-- cd $(kpathsea_dir) && $(MAKE) $(makeargs)
-+$(kpathsea):
-+ true
-
--$(kpathsea_dir)/paths.h: $(kpathsea_srcdir)/texmf.in
-- cd $(kpathsea_dir) && $(MAKE) $(makeargs)
-+$(kpathsea_dir)/paths.h:
-+ true
- # End of tkpathsea.mk.