| Index: runtime/bin/extensions.cc
|
| diff --git a/runtime/bin/extensions.cc b/runtime/bin/extensions.cc
|
| index d28d1e151fd1788b97a357fa9f3a0b3a7d946ff8..0894f90fe6b63703b135e5868a00679a215dd195 100644
|
| --- a/runtime/bin/extensions.cc
|
| +++ b/runtime/bin/extensions.cc
|
| @@ -26,13 +26,21 @@ Dart_Handle Extensions::LoadExtension(const char* extension_url,
|
|
|
| // Extract the path and the extension name from the url.
|
| char* last_path_separator = strrchr(library_path, '/');
|
| + if (last_path_separator == NULL) {
|
| + last_path_separator = strrchr(library_path, '\\');
|
| + }
|
| + if (last_path_separator == NULL) {
|
| + free(library_path);
|
| + return Dart_NewApiError("Cannot find extension library directory");
|
| + }
|
| char* extension_name = last_path_separator + 1;
|
| +
|
| *last_path_separator = '\0'; // Terminate library_path at last separator.
|
|
|
| void* library_handle = LoadExtensionLibrary(library_path, extension_name);
|
| if (library_handle == NULL) {
|
| free(library_path);
|
| - return Dart_NewApiError("cannot find extension library");
|
| + return Dart_NewApiError("Cannot find extension library");
|
| }
|
|
|
| const char* strings[] = { extension_name, "_Init", NULL };
|
| @@ -44,7 +52,7 @@ Dart_Handle Extensions::LoadExtension(const char* extension_url,
|
| free(library_path);
|
|
|
| if (fn == NULL) {
|
| - return Dart_NewApiError("cannot find initialization function in extension");
|
| + return Dart_NewApiError("Cannot find initialization function in extension");
|
| }
|
| return (*fn)(parent_library);
|
| }
|
|
|