diff options
author | Kris Maglione <maglione.k@gmail.com> | 2008-12-12 11:20:46 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2008-12-12 11:20:46 -0500 |
commit | 76ea4cacc077e5ec8849ccc76f9f06756d4765e5 (patch) | |
tree | 0567950f5a326911248bfbde69dbfe6579c1923a /common/content/io.js | |
parent | e127db32730e416141c7a83cbe5dd1831f8c0b50 (diff) | |
download | pentadactyl-76ea4cacc077e5ec8849ccc76f9f06756d4765e5.tar.gz |
Revert checking $LIBERATOR_HOME. Sorry, Ted, this is the kind of change that should be discussed first.
Diffstat (limited to 'common/content/io.js')
-rw-r--r-- | common/content/io.js | 27 |
1 files changed, 8 insertions, 19 deletions
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 ); |