summaryrefslogtreecommitdiff
path: root/support/s2latex/s2latex.patch
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/s2latex/s2latex.patch
Initial commit
Diffstat (limited to 'support/s2latex/s2latex.patch')
-rw-r--r--support/s2latex/s2latex.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/support/s2latex/s2latex.patch b/support/s2latex/s2latex.patch
new file mode 100644
index 0000000000..e9111bfb7f
--- /dev/null
+++ b/support/s2latex/s2latex.patch
@@ -0,0 +1,95 @@
+The following are patches against the standard s2latex distribution (at
+least as of April 1996, but it doesn't look like it's going to be changing
+any time in the near future). They port s2latex to ANSI C (allowing it to
+compile and link correctly under all modern C compilers), as well as clean
+up the Makefile, fix make clean, and add a make distclean target.
+
+To apply these patches, use:
+
+ patch < s2latex.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 any corrections or additions to these patches, but be
+aware that I only compile s2latex; I don't actually use it. I therefore
+am not a good person to send general s2latex questions to.
+
+ Russ Allbery
+ rra@cs.stanford.edu
+
+--------------------------------------------------------------------------
+
+--- Makefile.orig Sun Aug 5 17:00:00 1990
++++ Makefile Sat Apr 6 17:29:11 1996
+@@ -1,12 +1,12 @@
+-CFLAGS=-O
++CFLAGS=-O2
+
+ all: s2latex s2latex.1
+
+ s2latex: y.tab.c lex.yy.c symtab.o symtab.h
+- cc ${CFLAGS} -o s2latex y.tab.c symtab.o -ll
++ $(CC) ${CFLAGS} -o s2latex y.tab.c symtab.o -ll
+
+ y.tab.c: s2l.y
+- yacc s2l.y
++ $(YACC) s2l.y
+
+ lex.yy.c: s2l.l
+ lex s2l.l
+@@ -15,7 +15,10 @@
+ tbl s2latex.tbl >s2latex.1
+
+ clean:
+- rm -f y.tab.c lex.yy.c core y.tab.h *.o s2latex.1
++ rm -f y.tab.c lex.yy.c core y.tab.h *.o s2latex
++
++distclean: clean
++ rm -f s2latex.1
+
+ mktar:
+ tar cvf s2latex.tar Makefile s2l.y s2l.l symtab.c symtab.h s2latex.tbl
+--- s2l.y.orig Sun Oct 7 17:00:00 1990
++++ s2l.y Sat Apr 6 17:28:08 1996
+@@ -38,7 +38,7 @@
+
+ #include <stdio.h>
+ #include <ctype.h>
+-#include <strings.h>
++#include <string.h>
+ #include "symtab.h"
+
+ #define DELBUFLEN 1024 /* "delayed" text buffer length (see comments
+@@ -317,7 +317,7 @@
+ | '<' { dprintf("{\\tt\\char`\\<}"); }
+ | '>' { dprintf("{\\tt\\char`\\>}"); }
+ | '|' { dprintf("{\\tt\\char`\\|}"); }
+- | '"' { if( dirquote ) {
++ | '\"' { if( dirquote ) {
+ dprintf( dquote? "'":"`");
+ dquote=!dquote;
+ } else
+@@ -353,9 +353,9 @@
+ argc--;
+ read_st( *argv );
+ } else {
+- if( index( *argv, 'k' ) )
++ if( strchr( *argv, 'k' ) )
+ kflag++;
+- if( index( *argv, 'q' ) )
++ if( strchr( *argv, 'q' ) )
+ dirquote = 0;
+ }
+ argv++;
+@@ -534,7 +534,7 @@
+ char *nlpos;
+
+ if( delayout ) {
+- if( nlpos = rindex( delbuf, '\n' ) ) {
++ if( nlpos = strrchr( delbuf, '\n' ) ) {
+ *nlpos = '\0';
+ printf( "%s", delbuf );
+ nlpos++;