[gs-cvs] rev 7477 - trunk/gs/src

ghostgum at ghostscript.com ghostgum at ghostscript.com
Fri Dec 8 21:04:05 PST 2006


Author: ghostgum
Date: 2006-12-08 21:04:05 -0800 (Fri, 08 Dec 2006)
New Revision: 7477

Modified:
   trunk/gs/src/gdevwpr2.c
Log:
Fix bug 688932 mswinpr2 doesn't clear temporary files.
Unwanted temporary file was being recreated during page output.  
We now delete the temporary file when the device is closed.


Modified: trunk/gs/src/gdevwpr2.c
===================================================================
--- trunk/gs/src/gdevwpr2.c	2006-12-09 04:24:39 UTC (rev 7476)
+++ trunk/gs/src/gdevwpr2.c	2006-12-09 05:04:05 UTC (rev 7477)
@@ -392,12 +392,13 @@
 
     /* gdev_prn_open opens a temporary file which we don't want */
     /* so we specify the name now so we can delete it later */
+    wdev->fname[0] = '\0';
     pfile = gp_open_scratch_file(gp_scratch_file_name_prefix,
 				 wdev->fname, "wb");
     fclose(pfile);
     code = gdev_prn_open(dev);
-    /* delete unwanted temporary file */
-    unlink(wdev->fname);
+    if ((code < 0) && wdev->fname[0])
+        unlink(wdev->fname);
 
     if (!wdev->nocancel) {
 	/* inform user of progress with dialog box and allow cancel */
@@ -444,6 +445,11 @@
     }
 
     code = gdev_prn_close(dev);
+
+    /* delete unwanted temporary file */
+    if (wdev->fname[0])
+	unlink(wdev->fname);
+
     return code;
 }
 



More information about the gs-cvs mailing list