Index: runtime/bin/loader.cc |
diff --git a/runtime/bin/loader.cc b/runtime/bin/loader.cc |
index 22204788a81b4197e7021f6c7f70665417e66e8d..c6370617203d571879e1ac094e13282dc92df109 100644 |
--- a/runtime/bin/loader.cc |
+++ b/runtime/bin/loader.cc |
@@ -8,6 +8,7 @@ |
#include "bin/builtin.h" |
#include "bin/dartutils.h" |
#include "bin/extensions.h" |
+#include "bin/file.h" |
#include "bin/lockers.h" |
#include "bin/utils.h" |
@@ -261,15 +262,6 @@ static bool LibraryHandleError(Dart_Handle library, Dart_Handle error) { |
} |
-static bool IsWindowsHost() { |
-#if defined(TARGET_OS_WINDOWS) |
- return true; |
-#else // defined(TARGET_OS_WINDOWS) |
- return false; |
-#endif // defined(TARGET_OS_WINDOWS) |
-} |
- |
- |
bool Loader::ProcessResultLocked(Loader* loader, Loader::IOResult* result) { |
// We have to copy everything we care about out of |result| because after |
// dropping the lock below |result| may no longer valid. |
@@ -320,8 +312,9 @@ bool Loader::ProcessResultLocked(Loader* loader, Loader::IOResult* result) { |
lib_path = lib_uri; |
} |
const char* extension_path = DartUtils::RemoveScheme(extension_uri); |
- if (strchr(extension_path, '/') != NULL || |
- (IsWindowsHost() && strchr(extension_path, '\\') != NULL)) { |
+ if (!File::IsAbsolutePath(extension_path) && |
+ ((strchr(extension_path, '/') != NULL) || |
+ (strstr(extension_path, File::PathSeparator()) != NULL))) { |
siva
2016/08/30 01:22:59
For non windows hosts looks like this check is rep
zra
2016/08/30 16:05:18
Avoided the duplicate test by checking the path se
|
loader->error_ = DartUtils::NewError( |
"Relative paths for dart extensions are not supported: '%s'", |
extension_path); |