Skip to content

Commit 4b0795d

Browse files
committed
Windows path fixes
Fix uppercase drive letters, paths with multiple backslashes. string.replace(string, string) only replaces the first match.
1 parent 290376f commit 4b0795d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/less/browser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function extractUrlParts(url, baseUrl) {
200200
// urlParts[4] = filename
201201
// urlParts[5] = parameters
202202

203-
var urlPartsRegex = /^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/,
203+
var urlPartsRegex = /^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i,
204204
urlParts = url.match(urlPartsRegex),
205205
returner = {}, directories = [], i, baseUrlParts;
206206

@@ -221,7 +221,7 @@ function extractUrlParts(url, baseUrl) {
221221
}
222222

223223
if (urlParts[3]) {
224-
directories = urlParts[3].replace("\\", "/").split("/");
224+
directories = urlParts[3].replace(/\\/g, "/").split("/");
225225

226226
// extract out . before .. so .. doesn't absorb a non-directory
227227
for(i = 0; i < directories.length; i++) {

0 commit comments

Comments
 (0)