Ethereal-dev: [Ethereal-dev] RETRY: bug: printing in windows needs access-rights to root direc

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Ph. Marek" <philipp.marek@xxxxxxxxxx>
Date: Fri, 11 Nov 2005 07:36:14 +0100
Hello everyone!

Another try at 
http://www.ethereal.com/lists/ethereal-dev/200507/msg00527.html.

How about this patch?

Regards,
Phil


=== gtk/print_dlg.c
==================================================================
--- gtk/print_dlg.c     (revision 2184)
+++ gtk/print_dlg.c     (local)
@@ -859,7 +859,9 @@
     win_printer = TRUE;
     /*XXX should use temp file stuff in util routines */
     g_free(args->file);
-    args->file = g_strdup(tmpnam(NULL));
+    dirname=getenv("TEMP");
+    if (!dirname) dirname=getenv("TMP");
+    args->file = g_strdup(tempnam(dirname, NULL));
     args->to_file = TRUE;
 #else
     g_free(args->cmd);