summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvi2tty/dvi2tty.patch
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-17 21:41:51 +0000
committerKarl Berry <karl@freefriends.org>2006-01-17 21:41:51 +0000
commit487ca4806cc046076293cf6cc5fbba0db282bac7 (patch)
tree847b412ab5158dd7bdd7ed7e5a4cc3fbca94be32 /Build/source/texk/dvi2tty/dvi2tty.patch
parenta3d3111bfe26b8e5f5bc6049dfb2a4ca2edc7881 (diff)
texk 1
git-svn-id: svn://tug.org/texlive/trunk@1485 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvi2tty/dvi2tty.patch')
-rw-r--r--Build/source/texk/dvi2tty/dvi2tty.patch91
1 files changed, 91 insertions, 0 deletions
diff --git a/Build/source/texk/dvi2tty/dvi2tty.patch b/Build/source/texk/dvi2tty/dvi2tty.patch
new file mode 100644
index 00000000000..392a419fc0b
--- /dev/null
+++ b/Build/source/texk/dvi2tty/dvi2tty.patch
@@ -0,0 +1,91 @@
+The following are patches against the standard dvi2tty distribution (at
+least as of March of 1996, but it doesn't look like it's going to be
+changing any time in the near future). The original code doesn't
+null-terminate a string at several points, apparently relying on the
+assumption that all memory will be zeroed. This is not the case on
+several systems, most notably Linux. These patches will also clean up the
+Makefile and add a make clean target.
+
+To apply these patches, use:
+
+ patch < dvi2tty.patch
+
+If you don't have patch on your system, you can obtain it from
+prep.ai.mit.edu (or any mirror) in /pub/gnu; I highly recommend you
+install it. Alternately, you can just make the below changes by hand
+(there aren't very many).
+
+Feel free to send me questions, other problems, corrections, and the like,
+but please be aware that I am not the official maintainer of this package,
+and although I use it I do not know a lot about the internals. I'll try
+to help, but don't expect too much.
+
+ Russ Allbery
+ rra@cs.stanford.edu
+
+--------------------------------------------------------------------------
+
+--- dvi2tty/Makefile.orig Fri Mar 12 01:05:10 1993
++++ dvi2tty/Makefile Mon May 6 03:03:51 1996
+@@ -6,17 +6,20 @@
+ # This Makefile does not work for MSDOS. Make your
+ # own one, or compile by hand.
+ #
+-CFLAGS =
++CFLAGS = -O2
++CC = gcc
+
+ all: dvi2tty disdvi
+
+-dvi2tty:dvi2tty.o dvistuff.o
+- cc -o dvi2tty dvi2tty.o dvistuff.o
++dvi2tty: dvi2tty.o dvistuff.o
++ $(CC) $(CFLAGS) -o dvi2tty dvi2tty.o dvistuff.o
+
+-disdvi:disdvi.c commands.h
+- cc -o disdvi disdvi.o
++disdvi: disdvi.c commands.h
++ $(CC) $(CFLAGS) -o disdvi disdvi.c
+
+ dvi2tty.o: dvi2tty.c dvi2tty.h
+
+ dvistuff.o: dvistuff.c dvi2tty.h commands.h
+
++clean:
++ rm -f dvi2tty disdvi *.o
+--- dvi2tty/dvistuff.c.orig Fri Mar 12 01:05:35 1993
++++ dvi2tty/dvistuff.c Mon May 6 04:48:49 1996
+@@ -996,13 +996,14 @@
+ }
+ else
+ free(fnt->name); /* free old name */
+- if ((name = (char *) malloc(namelen * sizeof(char))) == NULL) {
++ if ((name = (char *) malloc((namelen + 1) * sizeof(char))) == NULL) {
+ perror("fontdef");
+ exit(1);
+ }
+
+ for (i = 0; i < namelen; i++)
+ name[i] = get1();
++ name[namelen] = '\0';
+ fnt->name = name;
+ if (new) {
+ fnt->next = fonts;
+--- dvi2tty/disdvi.c.orig Fri Mar 12 01:05:11 1993
++++ dvi2tty/disdvi.c Mon May 6 04:47:36 1996
+@@ -348,13 +348,14 @@
+ }
+ else
+ free(fnt->name); /* free old name */
+- if ((name = (char *) malloc(namelen * sizeof(char))) == NULL) {
++ if ((name = (char *) malloc((namelen + 1) * sizeof(char))) == NULL) {
+ perror("fontdef");
+ exit(1);
+ }
+
+ for (i = 0; i < namelen; i++)
+ name[i] = get1();
++ name[namelen] = '\0';
+ fnt->name = name;
+ if (new) {
+ fnt->next = fonts;