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

Unified Diff: runtime/bin/file_win.cc

Issue 8394041: Implement path canonicalization on Windows to fix infinite loop on cyclic includes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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 | « no previous file | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_win.cc
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index 185cce2903076d13f625c6d31e75446b12503c9a..8352c4901dab1774f2194a32080941542e0c8867 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -121,8 +121,11 @@ bool File::IsAbsolutePath(const char* pathname) {
char* File::GetCanonicalPath(const char* pathname) {
- // TODO(176): Need to implement this.
- return strdup(pathname);
+ int required_size = GetFullPathName(pathname, 0, NULL, NULL);
+ char* path = static_cast<char*>(malloc(required_size));
+ int written = GetFullPathName(pathname, required_size, path, NULL);
+ ASSERT(written == (required_size - 1));
+ return path;
}
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698