From 81da597f0c189a7311c2c4422e0950e5d8a85d2a Mon Sep 17 00:00:00 2001 From: anekos Date: Mon, 12 Apr 2010 17:34:00 +0000 Subject: expandPath 時に ../ のようなものを正規化 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37205 d0d07461-0603-4401-acd4-de1884942a52 --- auto_source.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'auto_source.js') 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) { -- cgit v1.2.3