diff --git a/lib/normalize.js b/lib/normalize.js index fd28c84..fffe743 100644 --- a/lib/normalize.js +++ b/lib/normalize.js @@ -1,5 +1,4 @@ -var doubleSlackUNCRegExp = /^\\\\/; -var doubleSlashWinRegExp = /\\+/g; +var doubleSlashWinRegExp = /(?!^)\\+/g;; var doubleSlashNixRegExp = /\/+/g; var currentDirectoryWinMiddleRegExp = /\\(\.\\)+/; var currentDirectoryWinEndRegExp = /\\\.$/; @@ -35,13 +34,7 @@ module.exports = function normalize(path) { path = path.replace(parentDirectoryNixEndRegExp2, ""); path = path.replace(parentDirectoryNixEndRegExp3, "/"); - var unc = doubleSlackUNCRegExp.test(path); - - path = path.replace(doubleSlashWinRegExp, "\\").replace(doubleSlashNixRegExp, "/") - - if (unc) { - path = '\\' + path; - } + path = path.replace(doubleSlashWinRegExp, "\\").replace(doubleSlashNixRegExp, "/"); return path; };