Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Unified Diff: runtime/bin/extensions.cc

Issue 57923004: Allow Windows network share paths for the script path and the package root. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698