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

Unified Diff: runtime/bin/dartutils.cc

Issue 2087723002: Fix canonicalization of relative paths, Dart_DefaultCanonicalizeUrl expects the base)url to end wit… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months 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
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/gen_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 4a9a247c3424830e13043ca8c32f81277e4a1753..55da17d932e4ede39bce949efdd62cf6d8b02c27 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -933,6 +933,18 @@ bool DartUtils::SetOriginalWorkingDirectory() {
}
+Dart_Handle DartUtils::GetCanonicalizableWorkingDirectory() {
+ const char* str = DartUtils::original_working_directory;
+ intptr_t len = strlen(str);
+ if ((str[len] == '/') || (IsWindowsHost() && str[len] == '\\')) {
+ return Dart_NewStringFromCString(str);
+ }
+ char* new_str = reinterpret_cast<char*>(Dart_ScopeAllocate(len + 2));
+ snprintf(new_str, (len + 2), "%s%s", str, File::PathSeparator());
+ return Dart_NewStringFromCString(new_str);
+}
+
+
// Statically allocated Dart_CObject instances for immutable
// objects. As these will be used by different threads the use of
// these depends on the fact that the marking internally in the
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/gen_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698