summaryrefslogtreecommitdiff
path: root/print/pstotext
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2000-02-02 07:32:10 +0000
committerKris Kennaway <kris@FreeBSD.org>2000-02-02 07:32:10 +0000
commit28c30ae35d0ce5c588f25620aa252cc32909becb (patch)
tree3c385f4efc627153078186ae6835a754fe8cfa5d /print/pstotext
parentUpgrade to 0.8.3 which obsoletes patches/patch-ab (diff)
Respect CC and CFLAGS, and create the tempfile securely with mkstemp()
while I'm here.
Notes
Notes: svn path=/head/; revision=25403
Diffstat (limited to 'print/pstotext')
-rw-r--r--print/pstotext/files/patch-aa39
-rw-r--r--print/pstotext/files/patch-ab21
2 files changed, 57 insertions, 3 deletions
diff --git a/print/pstotext/files/patch-aa b/print/pstotext/files/patch-aa
index 5ae6d984b972..2fcccc5f9aa8 100644
--- a/print/pstotext/files/patch-aa
+++ b/print/pstotext/files/patch-aa
@@ -1,6 +1,39 @@
---- Makefile.orig Wed Oct 28 17:45:58 1998
-+++ Makefile Mon Dec 6 14:36:17 1999
-@@ -43,2 +43,7 @@
+--- Makefile.orig Wed Oct 28 08:45:58 1998
++++ Makefile Tue Feb 1 23:21:29 2000
+@@ -8,7 +8,8 @@
+ # commenting out the includes of ptotdll.h in ptotdll.c and main.c.
+ # PMcJ 6 Sep 96
+
+-CC=gcc
++CC?=gcc
++CFLAGS?=-O2
+ #CC=cc -std
+
+ BUNDLE = ocr.h rot270.h rot90.h
+@@ -16,10 +17,10 @@
+ all: pstotext
+
+ main.o: ptotdll.h bundle.h ocr.h rot270.h rot90.h
+- $(CC) -c $*.c
++ $(CC) ${CFLAGS} -c $*.c
+
+ ptotdll.o: ptotdll.h
+- $(CC) -c $*.c
++ $(CC) ${CFLAGS} -c $*.c
+
+ pstotext: bundle.o main.o ptotdll.o
+ $(CC) -o pstotext main.o bundle.o ptotdll.o -lm
+@@ -27,7 +28,7 @@
+ .SUFFIXES: .ps
+
+ .c.o:
+- $(CC) -c $*.c
++ $(CC) ${CFLAGS} -c $*.c
+
+ # "Bundle" an Ascii file.
+ .ps.h:
+@@ -42,3 +43,8 @@
+
clean:
rm -f pstotext *.o core $(BUNDLE)
+
diff --git a/print/pstotext/files/patch-ab b/print/pstotext/files/patch-ab
new file mode 100644
index 000000000000..8594e9c85619
--- /dev/null
+++ b/print/pstotext/files/patch-ab
@@ -0,0 +1,21 @@
+--- main.c.orig Fri Oct 16 16:27:57 1998
++++ main.c Tue Feb 1 23:29:34 2000
+@@ -90,13 +90,16 @@
+ static char *make_temp(b) BUNDLE b; {
+ /* Return pathname of temporary file containing bundle "b". Caller
+ should unlink file (and, technically, free pathname). */
++ int fd;
+ FILE *f;
+ #ifdef VMS
+ char *path = tempnam("SYS$SCRATCH:", ".ps2t");
+ #else
+- char *path = tempnam("/tmp", ",ps2t");
++ char *path = strdup("/tmp/ps2tXXXXXXXXXX");
++ if ((fd = mkstemp(path)) == NULL)
++ {perror(cmd); exit(1);}
+ #endif
+- f = fopen(path, "w");
++ f = fdopen(fd, "w");
+ if (f==NULL) {perror(cmd); exit(1);}
+ putbundle(b, f);
+ fclose(f);