summaryrefslogtreecommitdiff
path: root/print/pstotext/files/patch-ab
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/files/patch-ab
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.
Diffstat (limited to '')
-rw-r--r--print/pstotext/files/patch-ab21
1 files changed, 21 insertions, 0 deletions
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);