From b24b45dd9bae16acdebf55626bae7f2ce53e1a18 Mon Sep 17 00:00:00 2001 From: Daniel Bainton Date: Thu, 11 Sep 2008 10:40:08 +0000 Subject: [PATCH] Adding hostname to the tmp file used with external editor --- content/io.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/io.js b/content/io.js index 591bef99..ba03cb9e 100644 --- a/content/io.js +++ b/content/io.js @@ -458,19 +458,20 @@ liberator.IO = function () //{{{ var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); - var tmpname = liberator.config.name.toLowerCase() + ".tmp"; + var tmpname = liberator.config.name.toLowerCase() + "-" + + window.content.document.location.hostname + ".tmp"; if (liberator.config.name == "Muttator") tmpname = "mutt-ator-mail"; // to allow vim to :set ft=mail automatically if (WINDOWS) { var dir = environmentService.get("TMP") || environmentService.get("TEMP") || "C:\\"; - file.initWithPath(dir + "\\" + tmpname); + file.initWithPath(dir + tmpname); } else { var dir = environmentService.get("TMP") || environmentService.get("TEMP") || "/tmp/"; - file.initWithPath(dir + "/" + tmpname); + file.initWithPath(dir + tmpname); } file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0600);