summaryrefslogtreecommitdiff
path: root/print/enscript/patches/patch-aa
blob: 5c91ded87fee0a915be58eab40367d885f529b4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
$NetBSD: patch-aa,v 1.1 2002/01/25 18:58:02 kleink Exp $

--- src/main.c.orig	Thu Jun 25 10:26:00 1998
+++ src/main.c	Fri Jan 25 19:35:40 2002
@@ -642,7 +642,6 @@
  * Print Table of Contents page.
  */
 int toc = 0;
-char toc_fname[512];
 FILE *toc_fp;
 char *toc_fmt_string;
 
@@ -1429,19 +1428,10 @@
       /* Table of Contents. */
       if (toc)
 	{
-	  cp = tmpnam (toc_fname);
-	  if (cp == NULL)
+	  toc_fp = tmpfile ();
+	  if (toc_fp == NULL)
 	    FATAL ((stderr, _("couldn't create toc file name: %s"),
 		    strerror (errno)));
-
-	  toc_fp = fopen (toc_fname, "w+b");
-	  if (toc_fp == NULL)
-	    FATAL ((stderr, _("couldn't create toc file \"%s\": %s"),
-		    toc_fname, strerror (errno)));
-
-	  if (remove (toc_fname) == 0)
-	    /* Remove successfull, no need to remove file at exit. */
-	    toc_fname[0] = '\0';
 	}
 
 
@@ -1519,10 +1509,6 @@
 
 	  /* Clean up toc file. */
 	  fclose (toc_fp);
-
-	  /* Do we have to remove the toc file? */
-	  if (toc_fname[0])
-	    (void) remove (toc_fname);
 	}
 
       /* Give trailer a chance to dump itself. */