Blob Blame History Raw
Index: plugin/plugin.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/plugin.cpp,v
retrieving revision 1.39
diff -u -r1.39 plugin.cpp
--- plugin/plugin.cpp	10 Aug 2006 18:49:44 -0000	1.39
+++ plugin/plugin.cpp	16 Aug 2006 10:24:30 -0000
@@ -442,8 +442,13 @@
 
     end   = url.find(".swf", 0) + 4;
     start = url.rfind("/", end) + 1;
-    fname = "/tmp/";
-    fname += url.substr(start, end - start);
+    char* dirtemp = strdup ("/tmp/gnash-XXXXXX");
+    fname = mkdtemp (dirtemp);
+    if (fname.empty ()) {
+      free (dirtemp);
+      fname = "/tmp";
+    }
+    fname += "/" + url.substr(start, end - start);
 
     // extract the parameters from the URL
     start = url.find("?", end);