diff options
author | kris <kris@FreeBSD.org> | 2000-02-02 07:32:10 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2000-02-02 07:32:10 +0000 |
commit | afa49a4089fef170483732040cb57efd91cc3d73 (patch) | |
tree | f2f50dd71a8edf7b20304dbc2fc27177050c2529 /print/pstotext | |
parent | 03820db67669c3d2ed8043e8294939522067aa70 (diff) | |
download | FreeBSD-ports-afa49a4089fef170483732040cb57efd91cc3d73.zip FreeBSD-ports-afa49a4089fef170483732040cb57efd91cc3d73.tar.gz |
Respect CC and CFLAGS, and create the tempfile securely with mkstemp()
while I'm here.
Diffstat (limited to 'print/pstotext')
-rw-r--r-- | print/pstotext/files/patch-aa | 39 | ||||
-rw-r--r-- | print/pstotext/files/patch-ab | 21 |
2 files changed, 57 insertions, 3 deletions
diff --git a/print/pstotext/files/patch-aa b/print/pstotext/files/patch-aa index 5ae6d98..2fcccc5 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 0000000..8594e9c --- /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); |