Skip to content

Commit febc020

Browse files
committed
Fix isAbsolutePath test for Windows style c:\ paths
1 parent 5f70543 commit febc020

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

emcc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ def generate_html(target, options, js_target, target_basename,
25592559
memoryInitializer = Module['memoryInitializerPrefixURL'] + memoryInitializer;
25602560
}
25612561
// If URL to memory initializer is relative, treat it relative with respect to Module['scriptDirectory'], if that is present.
2562-
if (Module['scriptDirectory'] && !/^(?:[a-z]+:)?\/\/?/i.test(memoryInitializer)) memoryInitializer = Module['scriptDirectory'] + memoryInitializer;
2562+
if (Module['scriptDirectory'] && !/^(?:[a-z]+:)?[\/\\]\/?/i.test(memoryInitializer)) memoryInitializer = Module['scriptDirectory'] + memoryInitializer;
25632563
Module['memoryInitializerRequestURL'] = memoryInitializer;
25642564
var meminitXHR = Module['memoryInitializerRequest'] = new XMLHttpRequest();
25652565
meminitXHR.open('GET', memoryInitializer, true);

src/preamble.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ function stackTrace() {
834834
}
835835

836836
function isAbsolutePath(path) {
837-
return /^(?:[a-z]+:)?\/\/?/i.test(path);
837+
return isDataURI(path) || /^(?:[a-z]+:)?[\/\\]\/?/i.test(path);
838838
}
839839

840840
// Joins relative URL 'b' to URL 'a'. 'a' may be empty, in which case 'b' is returned.
@@ -843,7 +843,7 @@ function joinUrl(a, b) {
843843
#if ASSERTIONS
844844
if (a && !a.endsWith('/')) throw 'First parameter to joinUrl() should end in /!';
845845
#endif
846-
return a && !isAbsolutePath(b) ? a + b : b;
846+
return (a && !isAbsolutePath(b)) ? a + b : b;
847847
}
848848
// Memory management
849849

0 commit comments

Comments
 (0)