summaryrefslogtreecommitdiff
path: root/print/enscript/patches/patch-ab
diff options
context:
space:
mode:
Diffstat (limited to 'print/enscript/patches/patch-ab')
-rw-r--r--print/enscript/patches/patch-ab57
1 files changed, 57 insertions, 0 deletions
diff --git a/print/enscript/patches/patch-ab b/print/enscript/patches/patch-ab
new file mode 100644
index 00000000000..12d40ccb4bd
--- /dev/null
+++ b/print/enscript/patches/patch-ab
@@ -0,0 +1,57 @@
+$NetBSD: patch-ab,v 1.1 2002/01/25 18:58:02 kleink Exp $
+
+--- src/psgen.c.orig Thu Jun 25 09:18:54 1998
++++ src/psgen.c Fri Jan 25 19:39:07 2002
+@@ -2398,7 +2398,7 @@
+ read_float (InputStream *is, int units, int horizontal)
+ {
+ char buf[256];
+- int i, ch;
++ int i, ch = 0;
+ double val;
+
+ for (i = 0; (i < sizeof (buf) - 1
+@@ -2618,31 +2618,15 @@
+ static void
+ divert ()
+ {
+- char *cp;
+-
+ assert (divertfp == NULL);
+
+ /* Open divert file. */
+
+- cp = tempnam (NULL, "ens");
+- if (cp == NULL)
+- FATAL ((stderr, _("couldn't create divert file name: %s"),
+- strerror (errno)));
+-
+- strcpy (divertfname, cp);
+-
+- divertfp = fopen (divertfname, "w+b");
++ divertfp = tmpfile ();
+ if (divertfp == NULL)
+ FATAL ((stderr, _("couldn't create divert file \"%s\": %s"), divertfname,
+ strerror (errno)));
+
+- if (remove (divertfname) == 0)
+- /* Remove successfull, no need to remove file in undivert(). */
+- divertfname[0] = '\0';
+-
+- /* Free the buffer allocated by tempnam(). */
+- free (cp);
+-
+ cofp = divertfp;
+ }
+
+@@ -2696,10 +2680,6 @@
+
+ fclose (divertfp);
+ divertfp = NULL;
+-
+- /* Do we have to remove the divert file? */
+- if (divertfname[0])
+- (void) remove (divertfname);
+
+ cofp = ofp;
+ }