From 76ea4cacc077e5ec8849ccc76f9f06756d4765e5 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 12 Dec 2008 11:20:46 -0500 Subject: Revert checking $LIBERATOR_HOME. Sorry, Ted, this is the kind of change that should be discussed first. --- common/content/io.js | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'common/content/io.js') diff --git a/common/content/io.js b/common/content/io.js index 493c5d7f..2ab444b4 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -409,26 +409,15 @@ function IO() //{{{ if (WINDOWS) path = path.replace("/", "\\", "g"); - /* expand "~" to - * (VIMPERATOR|MUTTATOR)_HOME or (depending on config.name) - * LIBERATOR_HOME or - * HOME (USERPROFILE or HOMEDRIVE\HOMEPATH on Windows if HOME is not set) - * in that order */ - if (/^~/.test(path)) + // expand ~ + if (path[0] == "~") { - // First try (VIMPERATOR|MUTTATOR)_HOME - let home = environmentService.get(config.name.toUpperCase() + "_HOME"); + // Try $(VIMPERATOR|MUTTATOR)_HOME || $HOME first, on all systems + let home = environmentService.get(config.name.toUpperCase() + "_HOME") || + environmentService.get("HOME"); - // If no (VIMPERATOR|MUTTATOR)_HOME, then try LIBERATOR_HOME - if (!home) - home = environmentService.get("LIBERATOR_HOME"); - - // If no (VIMPERATOR|MUTTATOR)_HOME, try HOME - if (!home) - home = environmentService.get("HOME"); - - // On Windows, stretch even farther for other options - if (WINDOWS && !home) + // Windows has its own ideosynchratic $HOME variables. + if (!home && WINDOWS) home = environmentService.get("USERPROFILE") || environmentService.get("HOMEDRIVE") + environmentService.get("HOMEPATH"); @@ -440,7 +429,7 @@ function IO() //{{{ // Kris reckons we shouldn't replicate this 'bug'. --djk // TODO: should we be doing this for all paths? path = path.replace( - RegExp("\\$(\\w+)\\b|\\${(\\w+)}" + (WINDOWS ? "|%(\\w+)%" : ""), "g"), + !WINDOWS ? /\$(\w+)\b|\${(\w+)}/g : /\$(\w+)\b|\${(\w+)}|%(\w+)%/g, function (m, n1, n2, n3) environmentService.get(n1 || n2 || n3) || m ); -- cgit v1.2.3