1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 17:57:58 +01:00

Fix IO.expandPath quirk on MS

This commit is contained in:
Kris Maglione
2008-12-24 13:07:36 -05:00
parent 3acf687340
commit deaba40c8f
2 changed files with 6 additions and 4 deletions

View File

@@ -944,7 +944,7 @@ IO.expandPath = function (path, relative)
path = expand(path);
// expand ~
if (!relative && (WINDOWS ? /^~(?:$|\\)/ : /^~(?:$|\/)/).test(path))
if (!relative && (WINDOWS ? /^~(?:$|[\\\/])/ : /^~(?:$|\/)/).test(path))
{
// Try $HOME first, on all systems
let home = services.get("environment").get("HOME");
@@ -961,9 +961,10 @@ IO.expandPath = function (path, relative)
// after, but doesn't document it. Is this just a bug? --Kris
path = expand(path);
// FIXME: Should we be doing this here? I think it should be done
// by the arg parser or nowhere. --Kris
return path.replace("\\ ", " ", "g");
if (WINDOWS)
path = path.replace("/", "\\", "g");
return path;
};
// vim: set fdm=marker sw=4 ts=4 et:

View File

@@ -1225,6 +1225,7 @@ const liberator = (function () //{{{
try
{
let infoPath = services.create("file");
liberator.dump("'rtp': " + IO.expandPath(IO.runtimePath.replace(/,.*/, "")));
infoPath.initWithPath(IO.expandPath(IO.runtimePath.replace(/,.*/, "")));
infoPath.append("info");
infoPath.append(services.get("profile").selectedProfile.name);