Skip to content

Commit 87ed8c0

Browse files
author
Lingjia
committed
Fixes #355 by adding test for windows device path;
1 parent c3a8f5a commit 87ed8c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/util.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ function join(aRoot, aPath) {
225225
return urlGenerate(aRootUrl);
226226
}
227227

228-
const joined = aPath.charAt(0) === "/"
228+
const joined = exports.isAbsolute(aPath.charAt(0))
229229
? aPath
230230
: normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
231231

@@ -238,7 +238,9 @@ function join(aRoot, aPath) {
238238
exports.join = join;
239239

240240
exports.isAbsolute = function(aPath) {
241-
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
241+
return aPath[0] === "/" ||
242+
(aPath[1] === ":" && (aPath[2] === "\\" || aPath[2] === "/")) ||
243+
urlRegexp.test(aPath);
242244
};
243245

244246
/**

0 commit comments

Comments
 (0)