1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-15 13:05:47 +01:00

Fix some :cd problems. Remove special treatement of ,, in 'cdpath'.

This commit is contained in:
Kris Maglione
2010-09-22 19:49:33 -04:00
parent 84ad7019bb
commit 68b0a826a7
11 changed files with 117 additions and 133 deletions

View File

@@ -532,14 +532,6 @@ const File = Class("File", {
expandPathList: function (list) list.map(this.expandPath),
getPathsFromPathList: function (list) {
if (!list)
return [];
// empty list item means the current directory
return list.replace(/,$/, "").split(",")
.map(function (dir) dir == "" ? io.getCurrentDirectory().path : dir);
},
isAbsolutePath: function (path) {
try {
services.create("file").initWithPath(path);
@@ -550,11 +542,12 @@ const File = Class("File", {
}
},
joinPaths: function (head, tail) {
let path = this(head);
joinPaths: function (head, tail, cwd) {
let path = this(head, cwd);
try {
// FIXME: should only expand env vars and normalise path separators
path.appendRelativePath(this.expandPath(tail, true));
path.normalize();
}
catch (e) {
return { exists: function () false, __noSuchMethod__: function () { throw e; } };