Fix "surprising path" error for paths like "K:"

This commit is contained in:
Slava Kim
2015-01-27 11:35:04 -08:00
parent f428b55e20
commit 07fa40f20e

View File

@@ -1175,7 +1175,7 @@ var toPosixPath = function (p, notAbsolute) {
var toDosPath = function (p, notAbsolute) {
if (p[0] === '/' && ! notAbsolute) {
if (! /^\/[A-Za-z]\//.test(p))
if (! /^\/[A-Za-z](\/|$)/.test(p))
throw new Error("Surprising path: " + p);
// transform a previously windows path back
// "/C/something" to "c:/something"