aboutsummaryrefslogtreecommitdiffstats
path: root/auto_source.js
diff options
context:
space:
mode:
authoranekos2010-04-12 17:34:00 +0000
committeranekos2010-04-12 17:34:00 +0000
commit81da597f0c189a7311c2c4422e0950e5d8a85d2a (patch)
tree9b287dbee8362eb987db83e7bc06b521d9a40f6a /auto_source.js
parentb8ca1a329a11740938c13e08e5051f0867caf544 (diff)
downloadvimperator-plugins-81da597f0c189a7311c2c4422e0950e5d8a85d2a.tar.bz2
expandPath 時に ../ のようなものを正規化
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37205 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'auto_source.js')
-rw-r--r--auto_source.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/auto_source.js b/auto_source.js
index 7079777..5ffb25f 100644
--- a/auto_source.js
+++ b/auto_source.js
@@ -121,12 +121,16 @@ let INFO =
(files = files.filter(function (it) (!(it.path.indexOf(filepath) === 0 && func(it)+'-'))));
function expandPath (filepath) {
+ function normalize (filepath)
+ let (file = io.File(filepath))
+ (file.normalize(), file.path);
+
filepath = io.expandPath(filepath);
if (filepath.match(/\/|\w:[\\\/]/))
- return filepath;
+ return normalize(filepath);
let cur = io.getCurrentDirectory();
cur.appendRelativePath(filepath);
- return cur.path;
+ return normalize(cur.path);
}
function startWatching (filepath, command, force, initHelp) {