From 28c30ae35d0ce5c588f25620aa252cc32909becb Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Wed, 2 Feb 2000 07:32:10 +0000 Subject: Respect CC and CFLAGS, and create the tempfile securely with mkstemp() while I'm here. --- print/pstotext/files/patch-aa | 39 ++++++++++++++++++++++++++++++++++++--- print/pstotext/files/patch-ab | 21 +++++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 print/pstotext/files/patch-ab 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); -- cgit v1.2.3