1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 09:48:00 +01:00

Adding hostname to the tmp file used with external editor

This commit is contained in:
Daniel Bainton
2008-09-11 10:40:08 +00:00
parent 8c3cfc4c8c
commit b24b45dd9b

View File

@@ -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);